diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-02-26 21:38:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-29 03:34:22 +0200 |
commit | 6fbd897caba6e4e9378c99030e9ce13652d785a6 (patch) | |
tree | 114ec0d8e4b0dfe2b41c4b3bc76594a137919f5b | |
parent | f33a2ea2eea70e805dd97659751284becccf9c3d (diff) | |
download | ffmpeg-6fbd897caba6e4e9378c99030e9ce13652d785a6.tar.gz |
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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/bit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c index 7b807b9bc1..5d05da0f81 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -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); |