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

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

From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Date: 2009-07-03 16:17:18

Ville Syrjälä schrieb:
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


Greetings,

Florian Tobias Schandinat

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