summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-08-12 16:02:52 +1000
committer Vas Crabb <vas@vastheman.com>2017-08-12 16:02:52 +1000
commitc179a4e0e96cda57c790151111404fd421e9e39f (patch)
treeb9dddb171338d531c9a08443db13ba572f7e71db /src/lib
parent71c7cfe5259f33e668dc3f870f6cf0433c073f51 (diff)
ui: save/restore images/info selection in right panel
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/png.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp
index 32ede1be9c1..7a0783cc47f 100644
--- a/src/lib/util/png.cpp
+++ b/src/lib/util/png.cpp
@@ -250,6 +250,8 @@ public:
return PNGERR_UNSUPPORTED_FORMAT; // unknown colour sample format
if ((0 != pnginfo.interlace_method) && (1 != pnginfo.interlace_method))
return PNGERR_UNSUPPORTED_FORMAT; // unknown interlace method
+ if (!pnginfo.bit_depth || (8 % pnginfo.bit_depth))
+ return PNGERR_UNSUPPORTED_FORMAT; // bit depth must be a factor of eight
// calculate the offset for each pass of the interlace on the input and output
unsigned const pass_count(get_pass_count());