aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-07-23 19:52:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-07-25 23:17:28 +0200
commitc5c719f030a209cc404754f928972a6c1a24dfef (patch)
treeaf90d9674271ce48c153e11d95469427bb720799
parent574f3aaeff6d04762f02044f1ee1e3564bc3ad00 (diff)
downloadffmpeg-c5c719f030a209cc404754f928972a6c1a24dfef.tar.gz
avcodec/h266_metadata_bsf: Check if there are CodedBitstreamFragment units
Fixes: NULL pointer dereference Fixes: 60269/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-5215449416335360 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>
-rw-r--r--libavcodec/h266_metadata_bsf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h266_metadata_bsf.c b/libavcodec/h266_metadata_bsf.c
index c0dbf8ef96..1f0f875cfe 100644
--- a/libavcodec/h266_metadata_bsf.c
+++ b/libavcodec/h266_metadata_bsf.c
@@ -43,7 +43,7 @@ static int h266_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt,
int err, i;
// If an AUD is present, it must be the first NAL unit.
- if (pu->units[0].type == VVC_AUD_NUT) {
+ if (pu->nb_units && pu->units[0].type == VVC_AUD_NUT) {
if (ctx->aud == BSF_ELEMENT_REMOVE)
ff_cbs_delete_unit(pu, 0);
} else if ( pkt && ctx->aud == BSF_ELEMENT_INSERT) {