avcodec/iff: Only write palette to plane 1 if its PAL8

Fixes: null pointer passed as argument 1, which is declared to never be null
Fixes: 33791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5107575256383488.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 216eb60b85)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-05-04 22:52:41 +02:00
parent d358379349
commit 459a60c3b1
1 changed files with 2 additions and 1 deletions

View File

@ -1845,7 +1845,8 @@ static int decode_frame(AVCodecContext *avctx,
buf += s->planesize;
}
}
memcpy(frame->data[1], s->pal, 256 * 4);
if (avctx->pix_fmt == AV_PIX_FMT_PAL8)
memcpy(frame->data[1], s->pal, 256 * 4);
} else if (s->ham) {
int i, count = 1 << s->ham;