[FFmpeg-cvslog] avformat/imx: Check palette chunk size

Michael Niedermayer git at videolan.org
Thu Apr 1 12:50:15 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar 30 12:47:22 2021 +0200| [45f40cec3ad68a2de7fd07e738cd5743a57b4735] | committer: Michael Niedermayer

avformat/imx: Check palette chunk size

Fixes: out of array write
Fixes: 32116/clusterfuzz-testcase-minimized-ffmpeg_dem_SIMBIOSIS_IMX_fuzzer-6702533894602752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit f7a515044766426cf3cac20bdc091b700f00a458)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/imx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/imx.c b/libavformat/imx.c
index d203ed7a28..22fca0bdc0 100644
--- a/libavformat/imx.c
+++ b/libavformat/imx.c
@@ -113,6 +113,8 @@ retry:
             imx->first_video_packet_pos = pos;
         break;
     case 0xAA98:
+        if (chunk_size > 256 * 3)
+            return AVERROR_INVALIDDATA;
         for (int i = 0; i < chunk_size / 3; i++) {
             unsigned r = avio_r8(pb) << 18;
             unsigned g = avio_r8(pb) << 10;



More information about the ffmpeg-cvslog mailing list