aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-30 00:13:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-30 00:13:36 +0200
commitccb6b056df35337b37e8083b15127fa466cd64f7 (patch)
treefef346ecf0c540c4a5a6e1f2218b31b74c7c3cb6
parenta6b79bb2b12ba5f7370ee5fbbdddfe86f1eeb12b (diff)
parent640a2427aafa774b83316b7a8c5c2bdc28bfd269 (diff)
downloadffmpeg-ccb6b056df35337b37e8083b15127fa466cd64f7.tar.gz
Merge commit '640a2427aafa774b83316b7a8c5c2bdc28bfd269'
* commit '640a2427aafa774b83316b7a8c5c2bdc28bfd269': bfi: Add some very basic sanity checks for input packet sizes Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/bfi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index 6f4d8cd8cd..b65a582e65 100644
--- a/libavformat/bfi.c
+++ b/libavformat/bfi.c
@@ -136,6 +136,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);