diff --git a/src/vector/stb/stb_image.h b/src/vector/stb/stb_image.h index 56f81830..1fd772dd 100644 --- a/src/vector/stb/stb_image.h +++ b/src/vector/stb/stb_image.h @@ -1930,7 +1930,7 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) } // bias[n] = (-1<s = s; stbi__setup_jpeg(j); @@ -3783,6 +3787,10 @@ static int stbi__jpeg_test(stbi__context *s) { int r; stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg)); + if (!j) { + stbi__errpuc("outofmem", "Out of memory"); + return 0; + } j->s = s; stbi__setup_jpeg(j); r = stbi__decode_jpeg_header(j, STBI__SCAN_type);