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-04 20:25:15 +0100
commitff01dbb6ec88285d11fb87be109007f398cb0e56 (patch)
tree4ee599c20aeafe1a3a6294490ff238ff1a7973a6
parent2caee48576871d54bf436a20e91fd81d61033cf4 (diff)
downloadffmpeg-ff01dbb6ec88285d11fb87be109007f398cb0e56.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 76bb3924b1..d733953a04 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);