Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-29 Thread Gerd Hoffmann
Hi, > > Not fully sure we can do that without breaking something, might be a > > negative stride is used for upside down images (last scanline comes > > first in memory). > > Ugh... Upside down images???... Well, OK, I guess. :) Well, in the unix world (x11, wayland) x=0,y=0 is the upper left

Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-28 Thread Laszlo Ersek
On 04/27/20 13:11, Gerd Hoffmann wrote: >>> -size = (hwaddr)linesize * height; >>> -data = cpu_physical_memory_map(addr, &size, false); >>> -if (size != (hwaddr)linesize * height) { >>> -cpu_physical_memory_unmap(data, size, 0, 0); >>> +mapsize = size = stride * (height - 1)

Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-27 Thread Gerd Hoffmann
> > -size = (hwaddr)linesize * height; > > -data = cpu_physical_memory_map(addr, &size, false); > > -if (size != (hwaddr)linesize * height) { > > -cpu_physical_memory_unmap(data, size, 0, 0); > > +mapsize = size = stride * (height - 1) + linesize; > > +data = cpu_physica

Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-24 Thread Laszlo Ersek
On 04/23/20 13:41, Gerd Hoffmann wrote: > Hi, > >> - if "linesize" is nonzero, make sure it is a whole multiple of the >> required word size (?) >> >> - if "linesize" is nonzero, make sure it is not bogus with relation to >> "width". I'm thinking something like: > > Yep, the whole linesize is a

Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-23 Thread Gerd Hoffmann
Hi, > - if "linesize" is nonzero, make sure it is a whole multiple of the > required word size (?) > > - if "linesize" is nonzero, make sure it is not bogus with relation to > "width". I'm thinking something like: Yep, the whole linesize is a bit bogus, noticed after sending out this series, I

Re: [PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-22 Thread Laszlo Ersek
On 04/22/20 12:02, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > hw/display/ramfb.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c > index fbe959147dc9..d1b1cb9bb294 100644 > --- a/hw/display/ramfb.c > +++ b/hw/display/ramfb.c

[PATCH 4/5] ramfb: add sanity checks to ramfb_create_display_surface

2020-04-22 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/display/ramfb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index fbe959147dc9..d1b1cb9bb294 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "hw/