diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-12-03 23:41:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | 50ac656fdd9fd41ab1caa645fd5a6cfcd764549a (patch) | |
tree | 02b7e2c1061bd7ffb42ff209508a462799df9045 | |
parent | c4da89d96226b2caaab3948a268261b1ec3bac7f (diff) | |
download | ffmpeg-50ac656fdd9fd41ab1caa645fd5a6cfcd764549a.tar.gz |
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>
(cherry picked from commit 380a3a0adfae7aa898d2ec8a5b0d5cd949a11111)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/rasc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c index cdf20a6db9..706940bf5f 100644 --- a/libavcodec/rasc.c +++ b/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]; |