In video/logo/pnmtologo.c, the function read_image can read from the image file an integer 0 and pass it to function get_number255, leading to a divide by zero problem. Signed-off-by: Yiyuan GUO <yguoaz@xxxxxxxxx> --- drivers/video/logo/pnmtologo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c index 4718d7895..cc8dca5ef 100644 --- a/drivers/video/logo/pnmtologo.c +++ b/drivers/video/logo/pnmtologo.c @@ -118,7 +118,12 @@ static unsigned int get_number(FILE *fp) static unsigned int get_number255(FILE *fp, unsigned int maxval) { - unsigned int val = get_number(fp); + unsigned int val; + + if (!maxval) + die("Corrupted maxval\n"); + + val = get_number(fp); return (255*val+maxval/2)/maxval; } -- 2.25.1