mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/h265_metadata_bsf: Check nb_units before accessing the first in h265_metadata_update_fragment()
Fixes: null pointer dereference Fixes: 32113/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-4803262287052800 Same as0c48c332ee
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit497ea04dbd
) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ddcaa14abb
commit
746fda9419
|
@ -359,7 +359,7 @@ static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
|
|||
}
|
||||
|
||||
// If an AUD is present, it must be the first NAL unit.
|
||||
if (au->units[0].type == HEVC_NAL_AUD) {
|
||||
if (au->nb_units && au->units[0].type == HEVC_NAL_AUD) {
|
||||
if (ctx->aud == REMOVE)
|
||||
ff_cbs_delete_unit(ctx->cbc, au, 0);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue