From fcfa17b847061d379893d083ef02ea743bb62c6d Mon Sep 17 00:00:00 2001 From: rmitton Date: Mon, 6 Jul 2015 13:32:40 -0700 Subject: [PATCH] Fixed double-free in JPEG allocation It was incorrectly setting the wrong field to NULL, causing it to get freed again later. --- stb_image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_image.h b/stb_image.h index d0fa9c2..293be74 100644 --- a/stb_image.h +++ b/stb_image.h @@ -2739,7 +2739,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) if (z->img_comp[i].raw_data == NULL) { for(--i; i >= 0; --i) { STBI_FREE(z->img_comp[i].raw_data); - z->img_comp[i].data = NULL; + z->img_comp[i].raw_data = NULL; } return stbi__err("outofmem", "Out of memory"); }