summaryrefslogtreecommitdiffstats
path: root/minuitwrp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-02-13 01:09:55 +0100
committerthat <github@that.at>2015-02-13 01:09:55 +0100
commitc26ba0d34424e9526a46bea23e9753d59a6be55c (patch)
treeb5713dcd85ad30407aa5ccfa2dcb705055a9713c /minuitwrp
parent2.8.5.0 (diff)
downloadandroid_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar.gz
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar.bz2
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar.lz
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar.xz
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.tar.zst
android_bootable_recovery-c26ba0d34424e9526a46bea23e9753d59a6be55c.zip
Diffstat (limited to 'minuitwrp')
-rw-r--r--minuitwrp/resources.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/minuitwrp/resources.c b/minuitwrp/resources.c
index 680bf56a3..3e3375d11 100644
--- a/minuitwrp/resources.c
+++ b/minuitwrp/resources.c
@@ -54,7 +54,7 @@ static GGLSurface* malloc_surface(size_t data_size) {
}
static int open_png(const char* name, png_structp* png_ptr, png_infop* info_ptr,
- png_uint_32* width, png_uint_32* height, png_byte* channels) {
+ png_uint_32* width, png_uint_32* height, png_byte* channels, FILE** fpp) {
char resPath[256];
unsigned char header[8];
int result = 0;
@@ -131,6 +131,7 @@ static int open_png(const char* name, png_structp* png_ptr, png_infop* info_ptr,
png_set_palette_to_rgb(png_ptr);
}
+ *fpp = fp;
return result;
exit:
@@ -219,10 +220,11 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) {
png_infop info_ptr = NULL;
png_uint_32 width, height;
png_byte channels;
+ FILE* fp;
*pSurface = NULL;
- result = open_png(name, &png_ptr, &info_ptr, &width, &height, &channels);
+ result = open_png(name, &png_ptr, &info_ptr, &width, &height, &channels, &fp);
if (result < 0) return result;
surface = init_display_surface(width, height);
@@ -247,6 +249,7 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) {
*pSurface = (gr_surface) surface;
exit:
+ fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
if (result < 0 && surface != NULL) free(surface);
return result;