From 1a4d99845e69f068c4b35187c2e76b600f643c33 Mon Sep 17 00:00:00 2001 From: Andrew Church Date: Sat, 16 Apr 2011 00:00:00 +0900 Subject: [PATCH] Fix compiler warnings --- src/glpng.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glpng.c b/src/glpng.c index 2e77638..e671bd1 100644 --- a/src/glpng.c +++ b/src/glpng.c @@ -118,6 +118,7 @@ static void Resize(int components, const png_bytep d1, int w1, int h1, png_bytep } } +#ifdef SUPPORTS_PALETTE_EXT #ifdef _WIN32 static int ExtSupported(const char *x) { static const GLubyte *ext = NULL; @@ -136,6 +137,7 @@ static int ExtSupported(const char *x) { return 0; } #endif +#endif #define GET(o) ((int)*(data + (o))) @@ -274,7 +276,7 @@ int APIENTRY pngLoadRawF(FILE *fp, pngRawInfo *pinfo) { if (pinfo == NULL) return 0; - fread(header, 1, 8, fp); + if (fread(header, 1, 8, fp) != 8) return 0; if (!png_check_sig(header, 8)) return 0; png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); @@ -675,7 +677,7 @@ int APIENTRY pngLoadF(FILE *fp, int mipmap, int trans, pngInfo *pinfo) { int ret = 0; - fread(header, 1, 8, fp); + if (fread(header, 1, 8, fp) != 8) return 0; if (!png_check_sig(header, 8)) return 0; png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); -- 2.11.4.GIT