Thread (12 messages) 12 messages, 3 authors, 2009-08-03

Re: [linux-fbdev-devel][PATCH]fb_pan_display:add x/yoffset check

From: Kai Jiang <hidden>
Date: 2009-07-06 03:01:01

Florian Tobias Schandinat wrote:
Ville Syrjälä schrieb:
quoted
quoted
So here we have to check the whether the x/yoffset is smaller than 
zero. If the offset is smaller than zero, in the driver, we should 
not move the virtual screen any more.
Checking for overflow will catch you buggy application's negative
values too.
That's true, but the problem lies in the current implementation first 
adding the resolution, which results in small negative [0 to 
-resolution] values (=large positives) being accepted as they overflow 
during add and become small positive values.
I'd recommend changing

var->yoffset + yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual

to

var->yoffset > info->var.yres_virtual - yres ||
var->xoffset > info->var.xres_virtual - info->var.xres
I am not sure why do we have these change. Could you give a detail 
description or an example?
Thanks!

Best Regards,

Kai Jiang



------------------------------------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help