more small coverity fixes

This commit is contained in:
John Cupitt 2015-09-30 13:42:42 +01:00
parent d3351c77a3
commit 864dfbf7aa
3 changed files with 11 additions and 5 deletions

View File

@ -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;

View File

@ -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];
}

View File

@ -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 );
}