File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1230,19 +1230,20 @@ static cairo_surface_t *read_gif_image(const char *image_path) {
1230
1230
int img_bottom = img_top + pimg -> ImageDesc .Height ;
1231
1231
1232
1232
/* Handle disposal mode */
1233
+ int data_size = width * height * ((int )sizeof (width ));
1233
1234
switch (gc .DisposalMode ) {
1234
1235
case DISPOSE_DO_NOT :
1235
1236
if (data_prev ) {
1236
- memcpy (data , data_prev , width * height * sizeof ( uint32_t ) );
1237
+ memcpy (data , data_prev , data_size );
1237
1238
} else {
1238
- memset (data , 0 , width * height * sizeof ( uint32_t ) );
1239
+ memset (data , 0 , data_size );
1239
1240
}
1240
1241
break ;
1241
1242
case DISPOSE_BACKGROUND :
1242
- memset (data , bg_color , width * height * sizeof ( uint32_t ) );
1243
+ memset (data , bg_color , data_size );
1243
1244
break ;
1244
1245
default :
1245
- memset (data , 0 , width * height * sizeof ( uint32_t ) );
1246
+ memset (data , 0 , data_size );
1246
1247
}
1247
1248
1248
1249
/* Read RGB */
You can’t perform that action at this time.
0 commit comments