From 7307e06122997f3d5e0108cd1bab4b11a1d5ebdc Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 18 Feb 2009 15:28:43 +0000 Subject: - 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. --- miscutils/fbsplash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'miscutils') diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 1ea5d8e..ec0f092 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c @@ -257,7 +257,9 @@ static void fb_drawimage(void) if (ENABLE_FEATURE_CLEAN_UP) free(head); - + if (width != G.scr_var.xres || height != G.scr_var.yres) + bb_error_msg_and_die("PPM %dx%d does not match screen %dx%d", + width, height, G.scr_var.xres, G.scr_var.yres); line_size = width*3; if (width > G.scr_var.xres) width = G.scr_var.xres; -- cgit v1.1