buf[0] = i & 255;
buf[1] = i / 256;
if (i_io_write(ig, buf, 2) == -1)
- return 0;
+ goto fail;
break;
case 'V':
buf[2] = (i >> 16) & 0xFF;
buf[3] = (i >> 24) & 0xFF;
if (i_io_write(ig, buf, 4) == -1)
- return 0;
+ goto fail;
break;
case 'C':
case 'c':
buf[0] = i & 0xFF;
if (i_io_write(ig, buf, 1) == -1)
- return 0;
+ goto fail;
break;
default:
va_end(ap);
return 1;
+
+ fail:
+ va_end(ap);
+ return 0;
}
/*
return NULL;
}
- if (xsize + 8 < xsize) { /* if there was overflow */
+ if ((i_img_dim)((i_img_dim_u)xsize + 8) < xsize) { /* if there was overflow */
/* we check with 8 because we allocate that much for the decoded
line buffer */
i_push_error(0, "integer overflow during memory allocation");