aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-21 21:19:43 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-03-21 22:27:14 +0100
commitdd1ce72e68f77c88fe8d258d83f7315c34b1eb11 (patch)
tree85aadc49a15f6b4283a0c71982f787689ec7b024 /libavcodec
parent4fdfe430c12225e819f68993474bd2f473c7e8b1 (diff)
downloadffmpeg-dd1ce72e68f77c88fe8d258d83f7315c34b1eb11.tar.gz
avcodec/allcodecs: Dont play with NULLs
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 <andreas.rheinhardt@outlook.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/allcodecs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b1aa7e266b..22d56760ec 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -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)