Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2022-03-25 04:20:26 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2022-03-25 04:21:18 +0300
commitd3999683ff5ac8b42de74cb453b459096f76f542 (patch)
treea392c82e37ba919a146d23052b25c7b2c7a179f6 /source/blender/imbuf
parent6e86cf0daab8df25b3edeb83e1e3b45fadbbb4af (diff)
WebP: Fix use after free
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/webp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/webp.c b/source/blender/imbuf/intern/webp.c
index 89e1686493d..19fe2373ea0 100644
--- a/source/blender/imbuf/intern/webp.c
+++ b/source/blender/imbuf/intern/webp.c
@@ -85,7 +85,6 @@ bool imb_savewebp(struct ImBuf *ibuf, const char *name, int UNUSED(flags))
}
last_row = (unsigned char *)(rgb_rect + (ibuf->y - 1) * ibuf->x * 3);
- MEM_freeN(rgb_rect);
if (ibuf->foptions.quality == 100.0f) {
encoded_data_size = WebPEncodeLosslessRGB(
@@ -95,6 +94,7 @@ bool imb_savewebp(struct ImBuf *ibuf, const char *name, int UNUSED(flags))
encoded_data_size = WebPEncodeRGB(
last_row, ibuf->x, ibuf->y, -3 * ibuf->x, ibuf->foptions.quality, &encoded_data);
}
+ MEM_freeN(rgb_rect);
}
else if (bytesperpixel == 4) {
last_row = (unsigned char *)(ibuf->rect + (ibuf->y - 1) * ibuf->x);