Skip to content
Snippets Groups Projects
Commit 17607549 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

On scale fail, but both buffers back in the pool

If do_scale ever failed, it would result in graphics buffers not
returning to the pool, resulting in them never being reused.
parent 6285417f
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2239 passed
......@@ -290,16 +290,22 @@ do_scale(struct rectlist* rect, int xscale, int yscale, int aspect_width, int as
size_t needsz = fwidth * fheight * sizeof(uint32_t);
if (needsz > ret1->sz) {
nt = realloc(ret1->data, needsz);
if (nt == NULL)
if (nt == NULL) {
release_buffer(ret1);
release_buffer(ret2);
return NULL;
}
ret1->data = nt;
ret1->sz = needsz;
}
if (needsz > ret2->sz) {
nt = realloc(ret2->data, needsz);
if (nt == NULL)
if (nt == NULL) {
release_buffer(ret1);
release_buffer(ret2);
return NULL;
}
ret2->data = nt;
ret2->sz = needsz;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment