Skip to content

Commit d8c9f54

Browse files
committed
test
1 parent 9ac300d commit d8c9f54

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,10 +1212,21 @@ public Bitmap transform(final Bitmap source) {
12121212
/ (source.getWidth() / notificationThumbnailWidth)),
12131213
true);
12141214

1215-
if (result != source) {
1215+
if (result == source) {
1216+
// create a new mutable bitmap to prevent strange crashes on some
1217+
// devices (see #4638)
1218+
final Bitmap copied = Bitmap.createScaledBitmap(
1219+
source,
1220+
(int) notificationThumbnailWidth - 1,
1221+
(int) (source.getHeight() / (source.getWidth()
1222+
/ (notificationThumbnailWidth - 1))),
1223+
true);
12161224
source.recycle();
1225+
return copied;
1226+
} else {
1227+
source.recycle();
1228+
return result;
12171229
}
1218-
return result;
12191230
}
12201231

12211232
@Override

0 commit comments

Comments
 (0)