summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-03-10 22:07:56 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2021-03-11 03:43:56 +0000
commiteb9f05f835dab48f8d5de4ac364c6a46670cc61c (patch)
tree1fdcce19beb60c302e5bc5673f850faac4c0f560 /apps
parent87e37a4d48ada935808aa85a86526b24ea482bb6 (diff)
downloadrockbox-eb9f05f835dab48f8d5de4ac364c6a46670cc61c.tar.gz
rockbox-eb9f05f835dab48f8d5de4ac364c6a46670cc61c.zip
ImageViewer Fix jpeg decoder
Image viewer compiles decoders as a plugin and removes CRT0 A resuklt static vars do not get initialized in decoders Change-Id: I72da326967c7b404b297897000f82852661a7ebb
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/imageviewer/jpeg/yuv2rgb.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/plugins/imageviewer/jpeg/yuv2rgb.c b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
index d0d5cb683b..61d7fd6487 100644
--- a/apps/plugins/imageviewer/jpeg/yuv2rgb.c
+++ b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
@@ -236,7 +236,7 @@ static fb_data (* const pixel_funcs[COLOUR_NUM_MODES][DITHER_NUM_MODES])(void) =
[DITHER_DIFFUSION] = pixel_fsdither_to_lcd,
},
};
-static fb_data *lcd_fb = NULL;
+
/* These defines are used fornormal horizontal strides and vertical strides. */
#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
#define LCDADDR(x, y) (lcd_fb + LCD_HEIGHT*(x) + (y))
@@ -261,12 +261,8 @@ void yuv_bitmap_part(unsigned char *src[3], int csub_x, int csub_y,
int x, int y, int width, int height,
int colour_mode, int dither_mode)
{
- if (!lcd_fb)
- {
- struct viewport *vp_main = *(rb->screens[SCREEN_MAIN]->current_viewport);
- lcd_fb = vp_main->buffer->fb_ptr;
- }
-
+ struct viewport *vp_main = *(rb->screens[SCREEN_MAIN]->current_viewport);
+ fb_data *lcd_fb = vp_main->buffer->fb_ptr;
fb_data *dst, *dst_end;
fb_data (*pixel_func)(void);
struct rgb_pixel px;