diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-28 23:46:04 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-29 19:59:32 +0300 |
commit | 640a2427aafa774b83316b7a8c5c2bdc28bfd269 (patch) | |
tree | 6fe98a337cd8c29e36355d45697e9c082176d120 | |
parent | 9fc7184d1a9af8d97b3fc5c2ef9d0a647d6617ea (diff) | |
download | ffmpeg-640a2427aafa774b83316b7a8c5c2bdc28bfd269.tar.gz |
bfi: Add some very basic sanity checks for input packet sizes
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/bfi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/bfi.c b/libavformat/bfi.c index 5d7ccb85e6..19060e760f 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -132,6 +132,10 @@ static int bfi_read_packet(AVFormatContext * s, AVPacket * pkt) video_offset = avio_rl32(pb); audio_size = video_offset - audio_offset; bfi->video_size = chunk_size - video_offset; + if (audio_size < 0 || bfi->video_size < 0) { + av_log(s, AV_LOG_ERROR, "Invalid audio/video offsets or chunk size\n"); + return AVERROR_INVALIDDATA; + } //Tossing an audio packet at the audio decoder. ret = av_get_packet(pb, pkt, audio_size); |