зеркало из https://github.com/mozilla/gecko-dev.git
Bug 867058 - Check bytes.length before decoding favicons. r=mfinkle
This commit is contained in:
Родитель
24524349b3
Коммит
35619dbcd5
|
@ -732,7 +732,7 @@ public class AwesomeBar extends GeckoActivity
|
|||
}
|
||||
|
||||
Bitmap bitmap = null;
|
||||
if (b != null) {
|
||||
if (b != null && b.length > 0) {
|
||||
bitmap = BitmapUtils.decodeByteArray(b);
|
||||
}
|
||||
|
||||
|
|
|
@ -874,7 +874,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
|
|||
do {
|
||||
final String url = c.getString(c.getColumnIndexOrThrow(Combined.URL));
|
||||
final byte[] b = c.getBlob(c.getColumnIndexOrThrow(Combined.FAVICON));
|
||||
if (b == null)
|
||||
if (b == null || b.length == 0)
|
||||
continue;
|
||||
|
||||
Bitmap favicon = BitmapUtils.decodeByteArray(b);
|
||||
|
|
|
@ -343,7 +343,7 @@ public class BookmarksTab extends AwesomeBarTab {
|
|||
|
||||
byte[] b = cursor.getBlob(cursor.getColumnIndexOrThrow(URLColumns.FAVICON));
|
||||
Bitmap favicon = null;
|
||||
if (b != null) {
|
||||
if (b != null && b.length > 0) {
|
||||
Bitmap bitmap = BitmapUtils.decodeByteArray(b);
|
||||
if (bitmap != null) {
|
||||
favicon = Favicons.getInstance().scaleImage(bitmap);
|
||||
|
|
|
@ -191,7 +191,7 @@ public class HistoryTab extends AwesomeBarTab {
|
|||
byte[] b = (byte[]) historyItem.get(URLColumns.FAVICON);
|
||||
Bitmap favicon = null;
|
||||
|
||||
if (b != null) {
|
||||
if (b != null && b.length > 0) {
|
||||
Bitmap bitmap = BitmapUtils.decodeByteArray(b);
|
||||
if (bitmap != null) {
|
||||
favicon = Favicons.getInstance().scaleImage(bitmap);
|
||||
|
|
|
@ -711,7 +711,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
|
|||
byte[] b = c.getBlob(faviconIndex);
|
||||
c.close();
|
||||
|
||||
if (b == null)
|
||||
if (b == null || b.length == 0)
|
||||
return null;
|
||||
|
||||
return BitmapUtils.decodeByteArray(b);
|
||||
|
|
|
@ -657,7 +657,7 @@ public class TopSitesView extends GridView {
|
|||
|
||||
final byte[] b = c.getBlob(c.getColumnIndexOrThrow(Thumbnails.DATA));
|
||||
Bitmap bitmap = null;
|
||||
if (b != null) {
|
||||
if (b != null && b.length > 0) {
|
||||
bitmap = BitmapUtils.decodeByteArray(b);
|
||||
}
|
||||
c.close();
|
||||
|
|
Загрузка…
Ссылка в новой задаче