@@ -369,26 +369,26 @@ image_buffer_resize(
369
369
if (width > image -> width ) { /* if width is extended */
370
370
for (n = 0 ; n < min_height ; ++ n ) {
371
371
/* copy from source image */
372
- memcpy (alt_buffer + width * n ,
373
- image -> data + image -> width * n ,
372
+ memcpy (alt_buffer + ( size_t ) width * n ,
373
+ image -> data + ( size_t ) image -> width * n ,
374
374
(size_t )image -> width );
375
375
/* fill extended area with background color */
376
- memset (alt_buffer + width * n + image -> width ,
376
+ memset (alt_buffer + ( size_t ) width * n + image -> width ,
377
377
bgindex ,
378
378
(size_t )(width - image -> width ));
379
379
}
380
380
} else {
381
381
for (n = 0 ; n < min_height ; ++ n ) {
382
382
/* copy from source image */
383
- memcpy (alt_buffer + width * n ,
384
- image -> data + image -> width * n ,
383
+ memcpy (alt_buffer + ( size_t ) width * n ,
384
+ image -> data + ( size_t ) image -> width * n ,
385
385
(size_t )width );
386
386
}
387
387
}
388
388
389
389
if (height > image -> height ) { /* if height is extended */
390
390
/* fill extended area with background color */
391
- memset (alt_buffer + width * image -> height ,
391
+ memset (alt_buffer + ( size_t ) width * image -> height ,
392
392
bgindex ,
393
393
(size_t )(width * (height - image -> height )));
394
394
}
@@ -472,7 +472,7 @@ sixel_decode_raw_impl(
472
472
int sx ;
473
473
int sy ;
474
474
int c ;
475
- int pos ;
475
+ size_t pos ;
476
476
unsigned char * p0 = p ;
477
477
478
478
while (p < p0 + len ) {
@@ -674,7 +674,7 @@ sixel_decode_raw_impl(
674
674
if (context -> repeat_count <= 1 ) {
675
675
for (i = 0 ; i < 6 ; i ++ ) {
676
676
if ((bits & sixel_vertical_mask ) != 0 ) {
677
- pos = image -> width * (context -> pos_y + i ) + context -> pos_x ;
677
+ pos = ( size_t ) image -> width * (context -> pos_y + i ) + context -> pos_x ;
678
678
image -> data [pos ] = context -> color_index ;
679
679
if (context -> max_x < context -> pos_x ) {
680
680
context -> max_x = context -> pos_x ;
0 commit comments