[Android] Do not decode picture blobs over 500k length

Jean-Baptiste Kempf git at videolan.org
Fri Oct 19 11:26:19 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Oct 19 11:20:24 2012 +0200| [4d54b5b58410d7bd0ceb6034b7bd4da8456e197e] | committer: Jean-Baptiste Kempf

Do not decode picture blobs over 500k length

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=4d54b5b58410d7bd0ceb6034b7bd4da8456e197e
---

 vlc-android/src/org/videolan/vlc/DatabaseManager.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/DatabaseManager.java b/vlc-android/src/org/videolan/vlc/DatabaseManager.java
index 65e6340..75831d1 100644
--- a/vlc-android/src/org/videolan/vlc/DatabaseManager.java
+++ b/vlc-android/src/org/videolan/vlc/DatabaseManager.java
@@ -438,7 +438,7 @@ public class DatabaseManager {
                 null, null, null);
         if (cursor.moveToFirst()) {
             blob = cursor.getBlob(0);
-            if (blob != null && blob.length > 1) {
+            if (blob != null && blob.length > 1 && blob.length < 500000) {
                 picture = BitmapFactory.decodeByteArray(blob, 0, blob.length);
                 blob = null;
             }



More information about the Android mailing list