1
0
Fork 0
forked from len0rd/rockbox

'Fix RED e200 Framebuffer_viewport_rewrite

Free malloc in checkwps too

Change-Id: I2b8fcbc94beb0644b643d3b7a9cb53bc26fc8a51
This commit is contained in:
William Wilgus 2020-10-26 15:32:37 -04:00
parent 04e7bacc4c
commit 299c237075
2 changed files with 23 additions and 15 deletions

View file

@ -448,7 +448,7 @@ void lcd_update(void)
lcd_write_cmd(R_WRITE_DATA_2_GRAM); lcd_write_cmd(R_WRITE_DATA_2_GRAM);
dbop_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); dbop_write_data((fb_data*)FBADDR(0,0), LCD_WIDTH*LCD_HEIGHT);
} }
/* Update a fraction of the display. */ /* Update a fraction of the display. */
@ -460,7 +460,7 @@ void lcd_update_rect(int x, int y, int width, int height)
return; return;
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) ||
(y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0)) (y >= LCD_HEIGHT) || (x + width <= 0) || (y + height <= 0))
return; return;

View file

@ -1,10 +1,10 @@
/*************************************************************************** /***************************************************************************
* __________ __ ___. * __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/ * \/ \/ \/ \/ \/
* $Id$ * $Id$
* *
* Copyright (C) 2008 by Dave Chapman * Copyright (C) 2008 by Dave Chapman
@ -167,9 +167,9 @@ int remote_getwidth(void) { return LCD_REMOTE_WIDTH; }
int remote_getheight(void) { return LCD_REMOTE_HEIGHT; } int remote_getheight(void) { return LCD_REMOTE_HEIGHT; }
#endif #endif
static inline bool backdrop_load(const char *filename, char* backdrop_buffer) static inline bool backdrop_load(const char *filename, char* backdrop_buffer)
{ {
(void)filename; (void)backdrop_buffer; return true; (void)filename; (void)backdrop_buffer; return true;
} }
struct screen screens[NB_SCREENS] = struct screen screens[NB_SCREENS] =
@ -253,6 +253,7 @@ struct font* font_get(int font)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ret = 0;
int res; int res;
int filearg = 1; int filearg = 1;
@ -302,7 +303,8 @@ int main(int argc, char **argv)
if (!ext) if (!ext)
{ {
printf("Invalid extension\n"); printf("Invalid extension\n");
return 2; ret = 2;
goto done;
} }
ext++; ext++;
if (!strcmp(ext, "rwps") || !strcmp(ext, "rsbs") || !strcmp(ext, "rfms")) if (!strcmp(ext, "rwps") || !strcmp(ext, "rsbs") || !strcmp(ext, "rfms"))
@ -321,7 +323,8 @@ int main(int argc, char **argv)
else else
{ {
printf("Invalid extension\n"); printf("Invalid extension\n");
return 2; ret = 2;
goto done;
} }
wps_screen = &screens[screen]; wps_screen = &screens[screen];
@ -330,12 +333,17 @@ int main(int argc, char **argv)
if (!res) { if (!res) {
printf("WPS parsing failure\n"); printf("WPS parsing failure\n");
skin_error_format_message(); skin_error_format_message();
return 3; ret = 3;
goto done;
} }
printf("WPS parsed OK\n\n"); printf("WPS parsed OK\n\n");
if (wps_verbose_level>2) if (wps_verbose_level>2)
skin_debug_tree(SKINOFFSETTOPTR(skin_buffer, wps.tree)); skin_debug_tree(SKINOFFSETTOPTR(skin_buffer, wps.tree));
} }
return 0;
done:
if (skin_buffer)
free(skin_buffer);
return ret;
} }