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-05 18:29:12 +0100
commit60ca730d215a99f0e275b3b3f8e09f4d820c16b8 (patch)
treed17f4e002697ac2202058e20bf78630e773eb7bd
parentebe104e827717b8ea5dfcb49c6f877e50a33425c (diff)
downloadffmpeg-60ca730d215a99f0e275b3b3f8e09f4d820c16b8.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);