git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
weblib: use more templats
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
LocalLibrary.java
diff --git
a/src/be/nikiroo/fanfix/library/LocalLibrary.java
b/src/be/nikiroo/fanfix/library/LocalLibrary.java
index 7220a3951de137f99a4a11ecc7e5f5b119abb3c1..f655d4d03bb43b5df69d00fc8b30b2adbad6c113 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/LocalLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/LocalLibrary.java
@@
-254,7
+254,13
@@
public class LocalLibrary extends BasicLibrary {
in = new FileInputStream(cover);
try {
synchronized (lock) {
in = new FileInputStream(cover);
try {
synchronized (lock) {
- sourceCovers.put(source, new Image(in));
+ Image img = new Image(in);
+ if (img.getSize() == 0) {
+ img.close();
+ throw new IOException(
+ "Empty image not accepted");
+ }
+ sourceCovers.put(source, img);
}
} finally {
in.close();
}
} finally {
in.close();
@@
-298,7
+304,13
@@
public class LocalLibrary extends BasicLibrary {
in = new FileInputStream(cover);
try {
synchronized (lock) {
in = new FileInputStream(cover);
try {
synchronized (lock) {
- authorCovers.put(author, new Image(in));
+ Image img = new Image(in);
+ if (img.getSize() == 0) {
+ img.close();
+ throw new IOException(
+ "Empty image not accepted");
+ }
+ authorCovers.put(author, img);
}
} finally {
in.close();
}
} finally {
in.close();