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

Commit 0eee8ac2 authored by Marco Nelissen's avatar Marco Nelissen Committed by Gerrit Code Review
Browse files

Merge "Fix thumbnail bug"

parents a06f5fa6 b416af13
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
@@ -655,6 +656,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;
                }