Commit eeda2c3d authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

avformat/bit: check that pkt->size is 10 in write_packet

Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 19dbe89f
......@@ -133,6 +133,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
GetBitContext gb;
int i;
if (pkt->size != 10)
return AVERROR(EINVAL);
avio_wl16(pb, SYNC_WORD);
avio_wl16(pb, 8 * 10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment