mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 03:40:18 +00:00
vector stb: check oom for safety.
This commit is contained in:
parent
985e64ad08
commit
fd110c3419
@ -3771,6 +3771,10 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
|
stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
|
||||||
|
if (!j) {
|
||||||
|
stbi__errpuc("outofmem", "Out of memory");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
j->s = s;
|
j->s = s;
|
||||||
result = stbi__jpeg_info_raw(j, x, y, comp);
|
result = stbi__jpeg_info_raw(j, x, y, comp);
|
||||||
STBI_FREE(j);
|
STBI_FREE(j);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user