소스 검색

Fixed double-free in JPEG allocation

It was incorrectly setting the wrong field to NULL, causing it to get
freed again later.
rmitton 10 년 전
부모
커밋
fcfa17b847
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      stb_image.h

+ 1 - 1
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");
       }