update from master
[fanfix.git] / supported / Cbz.java
index 7fe496d97ea8acb9e8869bb41c37d6723e19a636..a5391d07575e9f6102ab531e4a756c1be718f711 100644 (file)
@@ -97,7 +97,13 @@ class Cbz extends Epub {
                                        if (imageEntry) {
                                                String uuid = meta.getUuid() + "_" + entry.getName();
                                                try {
-                                                       images.put(uuid, new Image(zipIn));
+                                                       Image img = new Image(zipIn);
+                                                       if (img.getSize() == 0) {
+                                                               img.close();
+                                                               throw new IOException(
+                                                                               "Empty image not accepted");
+                                                       }
+                                                       images.put(uuid, img);
                                                } catch (Exception e) {
                                                        Instance.getInstance().getTraceHandler().error(e);
                                                }