Fix a NULL-deref in CoverArtController.java

ImageIO.read() can return null in certain cases
This commit is contained in:
jvoisin
2019-07-14 11:54:30 -06:00
committed by Andrew DeMaria
parent e9ea61036f
commit eccb7e08f5
@@ -381,7 +381,10 @@ public class CoverArtController implements LastModified {
InputStream in = null; InputStream in = null;
try { try {
in = getImageInputStream(coverArt); in = getImageInputStream(coverArt);
return scale(ImageIO.read(in), size, size); BufferedImage bimg = ImageIO.read(in);
if (bimg != null) {
return scale(bimg, size, size);
}
} catch (Throwable x) { } catch (Throwable x) {
LOG.warn("Failed to process cover art " + coverArt + ": " + x, x); LOG.warn("Failed to process cover art " + coverArt + ": " + x, x);
} finally { } finally {