Skip to content
/ FFmpeg Public
forked from FFmpeg/FFmpeg

Commit

Permalink
avcodec/allcodecs: Dont play with NULLs
Browse files Browse the repository at this point in the history
Fixes: member access within null pointer of type 'const FFCodec' (aka 'const struct FFCodec')
Fixes: 45726/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6554445419249664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Mar 21, 2022
1 parent 4fdfe43 commit dd1ce72
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libavcodec/allcodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,11 @@ const AVCodec *av_codec_iterate(void **opaque)

ff_thread_once(&av_codec_static_init, av_codec_init_static);

if (c)
if (c) {
*opaque = (void*)(i + 1);

return &c->p;
return &c->p;
}
return NULL;
}

static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
Expand Down

0 comments on commit dd1ce72

Please sign in to comment.