summaryrefslogtreecommitdiff
path: root/libavformat/idroqdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-29 02:58:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-29 19:26:26 +0100
commit744a0b5206634e5de04d5c31f08cc3640faf800d (patch)
treeb980f8d1cc9fa70e94e56d2743b51897639f09ca /libavformat/idroqdec.c
parent9e9c2276c308f90900d00574b4c9d5b91f41a5ab (diff)
avformat/idroqdec: Check chunk_size for being too large
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/idroqdec.c')
-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);