You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
cbs_apv: Fix memory leak on metadata parse failure
Buffers are allocated inside some metadata types, so we must ensure that the object is visible to the free function before a parse failure. Found by libFuzzer.
This commit is contained in:
@ -543,11 +543,11 @@ static int FUNC(metadata)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
current->metadata_count = p + 1;
|
||||
|
||||
CHECK(FUNC(metadata_payload)(ctx, rw, pl));
|
||||
|
||||
metadata_bytes_left -= pl->payload_size;
|
||||
|
||||
current->metadata_count = p + 1;
|
||||
if (metadata_bytes_left == 0)
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user