Fix a NULL-deref in CoverArtController.java

ImageIO.read() can return null in certain cases
master
jvoisin 6 years ago committed by Andrew DeMaria
parent e9ea61036f
commit eccb7e08f5
No known key found for this signature in database
GPG Key ID: 0A3F5E91F8364EDF
  1. 5
      airsonic-main/src/main/java/org/airsonic/player/controller/CoverArtController.java

@ -381,7 +381,10 @@ public class CoverArtController implements LastModified {
InputStream in = null;
try {
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) {
LOG.warn("Failed to process cover art " + coverArt + ": " + x, x);
} finally {

Loading…
Cancel
Save