0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

demux_mkv: ignore duplicated BlockAdditions to avoid memory leak

This can happen only on invalid files.

Found by OSS-Fuzz.
This commit is contained in:
Kacper Michajłow 2024-07-10 21:27:54 +02:00
parent b13642e115
commit 9158653982

View File

@ -3065,7 +3065,7 @@ static int read_block_group(demuxer_t *demuxer, int64_t end,
if (ebml_read_element(s, &parse_ctx, &additions,
&ebml_block_additions_desc) < 0)
return -1;
if (additions.n_block_more > 0) {
if (additions.n_block_more > 0 && !block->additions) {
block->additions = talloc_dup(NULL, &additions);
talloc_steal(block->additions, parse_ctx.talloc_ctx);
parse_ctx.talloc_ctx = NULL;