summaryrefslogtreecommitdiff
path: root/miscutils/fbsplash.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-02-18 15:28:43 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-02-18 15:28:43 +0000
commit7307e06122997f3d5e0108cd1bab4b11a1d5ebdc (patch)
treed09cc810940608072ea56d070b9811d0da3dfe25 /miscutils/fbsplash.c
parent8dcb33c3eb97ca668f609baf790fc79ac3f9da1c (diff)
downloadbusybox-w32-7307e06122997f3d5e0108cd1bab4b11a1d5ebdc.tar.gz
busybox-w32-7307e06122997f3d5e0108cd1bab4b11a1d5ebdc.tar.bz2
busybox-w32-7307e06122997f3d5e0108cd1bab4b11a1d5ebdc.zip
- bail out if screen resolution does not match PPM dimensions.
Previously a 640x480 PPM on an e.g. 720x400 console would just segfault when reading the lines. While this bug should perhaps be fixed to handle such cases properly we just exit gracefully until somebody is willing to take care of it properly.
Diffstat (limited to 'miscutils/fbsplash.c')
-rw-r--r--miscutils/fbsplash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c
index 1ea5d8ebb..ec0f092dc 100644
--- a/miscutils/fbsplash.c
+++ b/miscutils/fbsplash.c
@@ -257,7 +257,9 @@ static void fb_drawimage(void)
257 257
258 if (ENABLE_FEATURE_CLEAN_UP) 258 if (ENABLE_FEATURE_CLEAN_UP)
259 free(head); 259 free(head);
260 260 if (width != G.scr_var.xres || height != G.scr_var.yres)
261 bb_error_msg_and_die("PPM %dx%d does not match screen %dx%d",
262 width, height, G.scr_var.xres, G.scr_var.yres);
261 line_size = width*3; 263 line_size = width*3;
262 if (width > G.scr_var.xres) 264 if (width > G.scr_var.xres)
263 width = G.scr_var.xres; 265 width = G.scr_var.xres;