vector stb: check oom for safety.

This commit is contained in:
Hermet Park 2019-02-21 10:58:44 +09:00
parent 985e64ad08
commit fd110c3419

View File

@ -3771,6 +3771,10 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
{
int result;
stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
if (!j) {
stbi__errpuc("outofmem", "Out of memory");
return 0;
}
j->s = s;
result = stbi__jpeg_info_raw(j, x, y, comp);
STBI_FREE(j);