aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-29 02:58:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-06 00:07:50 +0100
commit8e4f737d2f25e13c0567cd34645c2791ba599d32 (patch)
tree93228d08d51cef062d43e67e41c63e4bb9f54c74
parent2d51cb1d0ad91ced96ca502d97481269de19eeb1 (diff)
downloadffmpeg-8e4f737d2f25e13c0567cd34645c2791ba599d32.tar.gz
avformat/idroqdec: Check chunk_size for being too large
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 744a0b5206634e5de04d5c31f08cc3640faf800d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/idroqdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index b66427968f..83701b59c5 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -157,6 +157,9 @@ static int roq_read_packet(AVFormatContext *s,
chunk_size = AV_RL32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
codebook_size;
+ if (chunk_size > INT_MAX)
+ return AVERROR_INVALIDDATA;
+
/* rewind */
avio_seek(pb, codebook_offset, SEEK_SET);