From f1b4b0cb1a6a161b04d744d69e5e8c603a64a61d Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Tue, 17 May 2022 23:04:20 +0200 Subject: [PATCH] Swap size_t with gint64 to catch read errors (#2811) This is similar to commit 5221df224f573653045799fdb98f8fdc19922f2d. --- libvips/foreign/matrixload.c | 2 +- libvips/foreign/svgload.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/matrixload.c b/libvips/foreign/matrixload.c index 5cec716d..5bc6f442 100644 --- a/libvips/foreign/matrixload.c +++ b/libvips/foreign/matrixload.c @@ -422,7 +422,7 @@ static int vips_foreign_load_matrix_source_is_a_source( VipsSource *source ) { unsigned char *data; - size_t bytes_read; + gint64 bytes_read; char line[80]; int width; int height; diff --git a/libvips/foreign/svgload.c b/libvips/foreign/svgload.c index 4b86980b..b39a7a7e 100644 --- a/libvips/foreign/svgload.c +++ b/libvips/foreign/svgload.c @@ -664,7 +664,7 @@ gboolean vips_foreign_load_svg_source_is_a_source( VipsSource *source ) { unsigned char *data; - size_t bytes_read; + gint64 bytes_read; if( (bytes_read = vips_source_sniff_at_most( source, &data, SVG_HEADER_SIZE )) <= 0 )