From 864dfbf7aa229bee69fb152020b99cc5f75f3f6e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 30 Sep 2015 13:42:42 +0100 Subject: [PATCH] more small coverity fixes --- libvips/foreign/csv.c | 4 +++- libvips/foreign/radiance.c | 2 +- libvips/foreign/webp2vips.c | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libvips/foreign/csv.c b/libvips/foreign/csv.c index 01dc0cb3..fa3fa101 100644 --- a/libvips/foreign/csv.c +++ b/libvips/foreign/csv.c @@ -467,7 +467,9 @@ fetch_nonwhite( FILE *fp, const char whitemap[256], char *buf, int max ) for( i = 0; i < max - 1; i++ ) { ch = vips__fgetc( fp ); - if( ch == EOF || ch == '\n' || whitemap[ch] ) + if( ch == EOF || + ch == '\n' || + whitemap[ch] ) break; buf[i] = ch; diff --git a/libvips/foreign/radiance.c b/libvips/foreign/radiance.c index a1bc4e55..74be61bb 100644 --- a/libvips/foreign/radiance.c +++ b/libvips/foreign/radiance.c @@ -966,7 +966,7 @@ rad2vips_process_line( char *line, Read *read ) COLOR cc; int i; - colcorval( cc, line ); + (void) colcorval( cc, line ); for( i = 0; i < 3; i++ ) read->colcor[i] *= cc[i]; } diff --git a/libvips/foreign/webp2vips.c b/libvips/foreign/webp2vips.c index 590ef38f..37cf5aeb 100644 --- a/libvips/foreign/webp2vips.c +++ b/libvips/foreign/webp2vips.c @@ -152,9 +152,13 @@ read_new( const char *filename, void *data, size_t length ) * mmap the input file, it's slightly quicker. */ if( (read->fd = vips__open_image_read( read->filename )) < 0 || - (read->length = vips_file_length( read->fd )) < 0 || - !(read->data = vips__mmap( read->fd, - FALSE, read->length, 0 )) ) { + (read->length = vips_file_length( read->fd )) < 0 ) { + read_free( read ); + return( NULL ); + } + + if( !(read->data = + vips__mmap( read->fd, FALSE, read->length, 0 )) ) { read_free( read ); return( NULL ); }