image: realloc rather than delete/new
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
9f47cb4d01
commit
c8b17808ef
4
image.c
4
image.c
|
@ -88,8 +88,8 @@ image_compute(image_t *image)
|
||||||
|
|
||||||
size = image->width * image->height;
|
size = image->width * image->height;
|
||||||
|
|
||||||
p_delete(&image->data);
|
p_realloc(&image->data, size * 4);
|
||||||
image->data = dataimg = p_new(uint8_t, size * 4);
|
dataimg = image->data;
|
||||||
|
|
||||||
for(i = 0; i < size; i++, dataimg += 4)
|
for(i = 0; i < size; i++, dataimg += 4)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue