From fc9c68307f9b706af8aabb52e943d0787a6f7180 Mon Sep 17 00:00:00 2001 From: Hubert Stachowiak <76792092+CreativeNameHUH@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:03:56 +0100 Subject: [PATCH] Fix Svace defects Defects: 508181, 514886, 508182 --- src/vector/stb/stb_image.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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);