[FFmpeg-devel] [PATCH 2/3] avcodec/cbs_av1: Clear obu.metadata on error
Michael Niedermayer
michael at niedermayer.cc
Fri Jun 2 01:26:00 EEST 2023
On error pointers can be left NULL while code later assumes these not to be NULL
Fixes: NULL pointer dereference
Fixes: 59359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-6726080594313216
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/cbs_av1.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 8788fee099..7f3f4da2f5 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -1013,8 +1013,10 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
case AV1_OBU_METADATA:
{
err = cbs_av1_read_metadata_obu(ctx, &gbc, &obu->obu.metadata);
- if (err < 0)
+ if (err < 0) {
+ memset(&obu->obu.metadata, 0, sizeof(obu->obu.metadata));
return err;
+ }
}
break;
case AV1_OBU_PADDING:
--
2.17.1
More information about the ffmpeg-devel
mailing list