[FFmpeg-cvslog] avcodec/dpx: Check elements in 12bps planar path

Michael Niedermayer git at videolan.org
Thu Jun 28 22:37:24 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jun 27 16:12:39 2018 +0200| [75a2db552423295b509546f3b0f8b2b46d3424b1] | committer: Michael Niedermayer

avcodec/dpx: Check elements in 12bps planar path

Fixes: null pointer dereference
Fixes: 8946/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5078915222601728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/dpx.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index f75e2cbbca..cf23bb6ba1 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -395,12 +395,14 @@ static int decode_frame(AVCodecContext *avctx,
                     if (elements == 4)
                         *dst[3]++ = read16(&buf, endian) >> shift & 0xFFF;
                 } else {
-                    *dst[2]++ = read12in32(&buf, &rgbBuffer,
-                                           &n_datum, endian);
+                    if (elements >= 3)
+                        *dst[2]++ = read12in32(&buf, &rgbBuffer,
+                                               &n_datum, endian);
                     *dst[0]++ = read12in32(&buf, &rgbBuffer,
                                            &n_datum, endian);
-                    *dst[1]++ = read12in32(&buf, &rgbBuffer,
-                                           &n_datum, endian);
+                    if (elements >= 2)
+                        *dst[1]++ = read12in32(&buf, &rgbBuffer,
+                                               &n_datum, endian);
                     if (elements == 4)
                         *dst[3]++ = read12in32(&buf, &rgbBuffer,
                                                &n_datum, endian);



More information about the ffmpeg-cvslog mailing list