diff options
Diffstat (limited to 'src/feh_png.c')
-rw-r--r-- | src/feh_png.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/feh_png.c b/src/feh_png.c index d27df01..8f5b94d 100644 --- a/src/feh_png.c +++ b/src/feh_png.c @@ -23,13 +23,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "feh_png.h" - #include <png.h> #include <stdio.h> #include <stdarg.h> +#include "feh_png.h" + #define FEH_PNG_COMPRESSION 3 #define FEH_PNG_NUM_COMMENTS 4 @@ -197,7 +197,10 @@ int feh_png_file_is_png(FILE * fp) { unsigned char buf[8]; - fread(buf, 1, 8, fp); + if (fread(buf, 1, 8, fp) != 8) { + return 0; + } + if (png_sig_cmp(buf, 0, 8)) { return 0; } |