summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-02-20 01:47:28 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-02-20 01:47:28 +0100
commit149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8 (patch)
treeeda4f51b5609b96df510c9af784d73b9509e1a33
parentDO NOT MERGE ANYWHERE Use synchronous writes when setting up BCB. am: 8559bbfb3b -s ours am: 52991c4639 -s ours (diff)
parentMerge "Fix minui cleanup path on error." (diff)
downloadandroid_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar.gz
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar.bz2
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar.lz
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar.xz
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.tar.zst
android_bootable_recovery-149b9eb2d82ae49e110c3fd95ab99dd726e0f9e8.zip
-rw-r--r--minui/resources.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/minui/resources.cpp b/minui/resources.cpp
index fdbe554fe..8489d60ef 100644
--- a/minui/resources.cpp
+++ b/minui/resources.cpp
@@ -283,7 +283,7 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps,
goto exit;
}
- surface = reinterpret_cast<GRSurface**>(malloc(*frames * sizeof(GRSurface*)));
+ surface = reinterpret_cast<GRSurface**>(calloc(*frames, sizeof(GRSurface*)));
if (surface == NULL) {
result = -8;
goto exit;
@@ -318,7 +318,7 @@ exit:
if (result < 0) {
if (surface) {
for (int i = 0; i < *frames; ++i) {
- if (surface[i]) free(surface[i]);
+ free(surface[i]);
}
free(surface);
}
@@ -421,7 +421,7 @@ int res_create_localized_alpha_surface(const char* name,
png_read_row(png_ptr, row.data(), NULL);
int w = (row[1] << 8) | row[0];
int h = (row[3] << 8) | row[2];
- int len = row[4];
+ __unused int len = row[4];
char* loc = reinterpret_cast<char*>(&row[5]);
if (y+1+h >= height || matches_locale(loc, locale)) {