avcodec/rasc: Check frame before clearing

Fixes: null pointer dereference
Fixes: 27737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5769028685266944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/371/head
Michael Niedermayer 4 years ago
parent ac5a568e6d
commit 380a3a0adf
  1. 3
      libavcodec/rasc.c

@ -70,6 +70,9 @@ static void clear_plane(AVCodecContext *avctx, AVFrame *frame)
RASCContext *s = avctx->priv_data;
uint8_t *dst = frame->data[0];
if (!dst)
return;
for (int y = 0; y < avctx->height; y++) {
memset(dst, 0, avctx->width * s->bpp);
dst += frame->linesize[0];

Loading…
Cancel
Save