Skip to content
Myr

Merge branch 'loadgif-realloc-sized' of https://github.com/SasLuca/stb into test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents b3a74a5, c5102ec · Browse files · 1 file+13 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−4 removed

  • other:+13 added−4 removed

1 file+13 added−4 removed

modified:stb_image.h+13 added-4 removed
107 unmodified lines
108 Julian Raschke Gregory Mullen Baldur Karlsson github:poppolopoppo109 Christian Floisand Kevin Schmidt JR Smith github:darealshinji110 Brad Weinberger Matvey Cherevko github:Michaelangel007111 Blazej Dariusz Roszkowski Alexander Veselov112 Luca Sas113*/114115#ifndef STBI_INCLUDE_STB_IMAGE_H116#define STBI_INCLUDE_STB_IMAGE_H
6566 unmodified lines
6683 stbi_uc *out = 0;6684 stbi_uc *two_back = 0;6685 stbi__gif g;6686 int stride;6687 int out_size = 0;6688 int delays_size = 0;6689 memset(&g, 0, sizeof(g));6690 if (delays) {6691 *delays = 0;6692 }
8 unmodified lines
6701 ++layers;6702 stride = g.w * g.h * 4;67036704 if (out) {6702 void *tmp = (stbi_uc*) STBI_REALLOC( out, layers * stride );6705 void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride );6706 if (NULL == tmp) {6707 STBI_FREE(g.out);6708 STBI_FREE(g.history);6709 STBI_FREE(g.background);6710 return stbi__errpuc("outofmem", "Out of memory");6711 }6709 else6710 out = (stbi_uc*) tmp;6712 else {6713 out = (stbi_uc*) tmp;6714 out_size = layers * stride;6715 }67166717 if (delays) {6712 *delays = (int*) STBI_REALLOC( *delays, sizeof(int) * layers );6718 *delays = (int*) STBI_REALLOC_SIZED( *delays, delays_size, sizeof(int) * layers );6719 delays_size = layers * sizeof(int);6720 }6721 } else {6722 out = (stbi_uc*)stbi__malloc( layers * stride );6723 out_size = layers * stride;6724 if (delays) {6725 *delays = (int*) stbi__malloc( layers * sizeof(int) );6726 delays_size = layers * sizeof(int);6727 }6728 }6729 memcpy( out + ((layers - 1) * stride), u, stride );6730 if (layers >= 2) {
935 unmodified lines