fix fd-leak

This commit is contained in:
Adrian Ulrich 2016-11-17 17:57:17 +01:00
parent 2b885824c2
commit 1e1fe4a375

View File

@ -458,11 +458,13 @@ public class CoverCache {
bopts.inJustDecodeBounds = true;
final int inSampleSize = getSampleSize(sampleInputStream, bopts, maxPxCount);
/* reuse bopts: we are now REALLY going to decode the image */
bopts.inJustDecodeBounds = false;
bopts.inSampleSize = inSampleSize;
return BitmapFactory.decodeStream(inputStream, null, bopts);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream, null, bopts);
sampleInputStream.close();
inputStream.close();
return bitmap;
}
} catch (Exception e) {
// no cover art found