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:
parent
a65d028fb1
commit
88f2ccdf16
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue