@@ -105,7 +105,7 @@ uint8* Decode(const void* srcdata, int datasize,
105
105
uint8* const dstdata =
106
106
allocate_output (target_num_frames, width, height, channel);
107
107
if (!dstdata) return nullptr ;
108
- for (ptrdiff_t k = 0 ; k < target_num_frames; k++) {
108
+ for (int64_t k = 0 ; k < target_num_frames; k++) {
109
109
uint8* this_dst = dstdata + k * width * channel * height;
110
110
111
111
SavedImage* this_image = &gif_file->SavedImages [k];
@@ -125,10 +125,10 @@ uint8* Decode(const void* srcdata, int datasize,
125
125
126
126
if (k > 0 ) {
127
127
uint8* last_dst = dstdata + (k - 1 ) * width * channel * height;
128
- for (ptrdiff_t i = 0 ; i < height; ++i) {
128
+ for (int64_t i = 0 ; i < height; ++i) {
129
129
uint8* p_dst = this_dst + i * width * channel;
130
130
uint8* l_dst = last_dst + i * width * channel;
131
- for (ptrdiff_t j = 0 ; j < width; ++j) {
131
+ for (int64_t j = 0 ; j < width; ++j) {
132
132
p_dst[j * channel + 0 ] = l_dst[j * channel + 0 ];
133
133
p_dst[j * channel + 1 ] = l_dst[j * channel + 1 ];
134
134
p_dst[j * channel + 2 ] = l_dst[j * channel + 2 ];
@@ -141,9 +141,9 @@ uint8* Decode(const void* srcdata, int datasize,
141
141
// If the first frame does not fill the entire canvas then fill the
142
142
// unoccupied canvas with zeros (black).
143
143
if (k == 0 ) {
144
- for (ptrdiff_t i = 0 ; i < height; ++i) {
144
+ for (int64_t i = 0 ; i < height; ++i) {
145
145
uint8* p_dst = this_dst + i * width * channel;
146
- for (ptrdiff_t j = 0 ; j < width; ++j) {
146
+ for (int64_t j = 0 ; j < width; ++j) {
147
147
p_dst[j * channel + 0 ] = 0 ;
148
148
p_dst[j * channel + 1 ] = 0 ;
149
149
p_dst[j * channel + 2 ] = 0 ;
@@ -165,9 +165,9 @@ uint8* Decode(const void* srcdata, int datasize,
165
165
return nullptr ;
166
166
}
167
167
168
- for (ptrdiff_t i = imgTop; i < imgBottom; ++i) {
168
+ for (int64_t i = imgTop; i < imgBottom; ++i) {
169
169
uint8* p_dst = this_dst + i * width * channel;
170
- for (ptrdiff_t j = imgLeft; j < imgRight; ++j) {
170
+ for (int64_t j = imgLeft; j < imgRight; ++j) {
171
171
GifByteType color_index =
172
172
this_image->RasterBits [(i - img_desc->Top ) * (img_desc->Width ) +
173
173
(j - img_desc->Left )];
0 commit comments