History

demux/ebml: bump ebml size limit to 512 MiB

While the code before 571f9b0f23f31741f3c5947b839411acfefae3cf had a typo and it was intended to be 100 MB, there are files that exceed this limit, like 147 MiB. Increase the limit to 512 MiB which should be more than enough for valid files. From quick look ffmpeg limits to 1<<8 bytes, so we should be good with our new limit. In theory this limit could be removed, but it is better to play the file, possibly with skipped some corrupted block of data, instead OOM.

Kacper Michajłow committed 2 years ago

Commit 4764e411 parent 202ecc11 file · +2 −2Browse files

Unified · Split

demux/ebml.c+2−2
@@ -604,8 +604,8 @@ int ebml_read_element(struct stream *s, struct ebml_parse_ctx *ctx, · 603 unmodified lines
604 MP_MSG(ctx, msglevel, "EBML element with unknown length - unsupported\n");604 MP_MSG(ctx, msglevel, "EBML element with unknown length - unsupported\n");
605 return -1;605 return -1;
606 }606 }
607 if (length > (128 << 20)) {607 if (length > (512 << 20)) {
608 MP_MSG(ctx, msglevel, "Refusing to read element over 128 MiB in size\n");608 MP_MSG(ctx, msglevel, "Element too big (%" PRIu64 " MiB) - skipping\n", length >> 20);
609 return -1;609 return -1;
610 }610 }
611 ctx->talloc_ctx = talloc_size(NULL, length);611 ctx->talloc_ctx = talloc_size(NULL, length);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t