Browse Source

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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 75a2db5524)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0.2
Michael Niedermayer 7 years ago
parent
commit
841e1399e6
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      libavcodec/dpx.c

+ 6
- 4
libavcodec/dpx.c View File

@@ -408,12 +408,14 @@ static int decode_frame(AVCodecContext *avctx,
if (elements == 4)
*dst[3]++ = read16(&buf, endian) >> 4;
} 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);


Loading…
Cancel
Save