Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-04 23:52:41 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 14:54:52 +0300
commit459a60c3b1cd33bb22896b0091aa0cbf4a46bd49 (patch)
tree04501ade020e873f2ed811414eac31538b64279a
parentd358379349973b79bbabc6525a787c40547e00de (diff)
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 216eb60b853e9a230c1238ab7d1c63d3fa892d34) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/iff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 6ec2dd60ad..dbd51cb895 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -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;