Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vo_gpu_next: raise LUT file max size and report an error if exceeded #15146

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -2058,8 +2058,14 @@ static void update_lut(struct priv *p, struct user_lut *lut)
// Load LUT file
char *fname = mp_get_user_path(NULL, p->global, lut->path);
MP_VERBOSE(p, "Loading custom LUT '%s'\n", fname);
struct bstr lutdata = stream_read_file(fname, p, p->global, 100000000); // 100 MB
lut->lut = pl_lut_parse_cube(p->pllog, lutdata.start, lutdata.len);
const int lut_max_size = 1536 << 20; // 1.5 GiB, matches lut cache limit
struct bstr lutdata = stream_read_file(fname, NULL, p->global, lut_max_size);
if (!lutdata.len) {
MP_ERR(p, "Failed to read LUT data from %s, make sure it's a valid file "
"and smaller or equal to %d bytes\n", fname, lut_max_size);
} else {
lut->lut = pl_lut_parse_cube(p->pllog, lutdata.start, lutdata.len);
}
talloc_free(fname);
talloc_free(lutdata.start);
}
Expand Down
Loading