Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 909a1b2e authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am c4d37f58: am 0eee8ac2: Merge "Fix thumbnail bug"

* commit 'c4d37f58':
  Fix thumbnail bug
parents ac777c82 c4d37f58
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;

/**
 * The Media provider contains meta data for all available media on both internal
@@ -659,6 +660,7 @@ public final class MediaStore {
                        if (sThumbBuf == null) {
                            sThumbBuf = new byte[MiniThumbFile.BYTES_PER_MINTHUMB];
                        }
                        Arrays.fill(sThumbBuf, (byte)0);
                        if (thumbFile.getMiniThumbFromFile(origId, sThumbBuf) != null) {
                            bitmap = BitmapFactory.decodeByteArray(sThumbBuf, 0, sThumbBuf.length);
                            if (bitmap == null) {
+2 −1
Original line number Diff line number Diff line
@@ -249,7 +249,8 @@ public class MiniThumbFile {
                long magic = mBuffer.getLong();
                int length = mBuffer.getInt();

                if (size >= 1 + 8 + 4 + length && data.length >= length) {
                if (size >= 1 + 8 + 4 + length && length != 0 && magic != 0 && flag == 1 &&
                        data.length >= length) {
                    mBuffer.get(data, 0, length);
                    return data;
                }