Commit 17607549 authored by Deucе's avatar Deucе 👌🏾
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
Pipeline #2239 passed with stage
in 8 minutes and 22 seconds
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment