[FFmpeg-cvslog] avformat/idroqdec: Check chunk_size for being too large

Michael Niedermayer git at videolan.org
Tue Dec 6 01:27:31 EET 2016


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov 29 02:58:34 2016 +0100| [8e4f737d2f25e13c0567cd34645c2791ba599d32] | committer: Michael Niedermayer

avformat/idroqdec: Check chunk_size for being too large

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 744a0b5206634e5de04d5c31f08cc3640faf800d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e4f737d2f25e13c0567cd34645c2791ba599d32
---

 libavformat/idroqdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index b664279..83701b5 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);
 



More information about the ffmpeg-cvslog mailing list