Description: Fixes FTBFS ignoring return value of fread Author: Thomas Goirand Bug-Debian: http://bugs.debian.org/664910 Forwarded: no --- xbubble-0.5.11.2.orig/src/loadpng.c +++ xbubble-0.5.11.2/src/loadpng.c @@ -48,6 +48,7 @@ unsigned char * load_png_file( const cha png_structp png_ptr; png_infop info_ptr; png_bytep *row_pointers; + size_t result; fd = fopen( file, "rb" ); if ( fd == NULL ) { @@ -55,7 +56,12 @@ unsigned char * load_png_file( const cha return NULL; } /* ensure that we opened a PNG file */ - fread( header, 1, 8, fd ); + result = fread( header, 1, 8, fd ); + if (result != 8){ + fclose(fd); + fprintf(stderr,_("Error while reading file %s.\n"), file); + return NULL; + } if ( ! png_check_sig( header, 8 ) ) { fclose(fd); fprintf(stderr,_("File %s does not have a valid PNG signature.\n"), file);