Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-07-11 20:18:20 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-07-11 20:18:20 +0300
commit5a19d9d8f352dd8491f8800ddc2e1c52337a25ca (patch)
treecc1f0cd5ed94bb043b1054c5b674d9743dbeb39f /source/blender/imbuf
parent3a810bfed6be4dc6645262eb6d4ca8064e1aea23 (diff)
ImBuf: Fix compilation error with older libpng
Older libpng library does not use const pointer to a memory. The exact version is a bit of a guess here, maybe needs tweaks to it tho.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/png.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index b96424dd319..77a0f1dc1db 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -71,7 +71,14 @@ int imb_is_a_png(const unsigned char *mem)
{
int ret_val = 0;
- if (mem) ret_val = !png_sig_cmp(mem, 0, 8);
+ if (mem) {
+#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR == 2)
+ /* Older version of libpng doesn't use const pointer to memory. */
+ ret_val = !png_sig_cmp((png_bytep)mem, 0, 8);
+#else
+ ret_val = !png_sig_cmp(mem, 0, 8);
+#endif
+ }
return(ret_val);
}