diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-26 00:00:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-26 19:27:53 +0100 |
commit | 718e862da3e254c58447c0873decb335f688fa09 (patch) | |
tree | 4c02b7932fa3a9ce9a65f988401f66515384f281 /libavcodec/av1dec.c | |
parent | 343c3149ab3d77be76f035d3b18bb2b2da48ce1f (diff) | |
download | ffmpeg-718e862da3e254c58447c0873decb335f688fa09.tar.gz |
avcodec/av1dec: Check for unset obu instead of crashing
Fixes: NULL pointer dereference
Fixes: 26550/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-5417762807349248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r-- | libavcodec/av1dec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index a0a279d65b..bb4295aa6f 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -673,7 +673,12 @@ static int av1_decode_frame(AVCodecContext *avctx, void *frame, for (int i = 0; i < s->current_obu.nb_units; i++) { CodedBitstreamUnit *unit = &s->current_obu.units[i]; AV1RawOBU *obu = unit->content; - const AV1RawOBUHeader *header = &obu->header; + const AV1RawOBUHeader *header; + + if (!obu) + continue; + + header = &obu->header; av_log(avctx, AV_LOG_DEBUG, "Obu idx:%d, obu type:%d.\n", i, unit->type); switch (unit->type) { |