[PATCH] Prevent zero sized wl_egl_window (original) (raw)

Kristian Høgsberg hoegsberg at gmail.com
Tue Feb 18 14:25:39 PST 2014


On Fri, Feb 14, 2014 at 09:31:45AM +0200, Pekka Paalanen wrote:

On Thu, 13 Feb 2014 18🔞23 +0000 "Yeh, Sinclair" <sinclair.yeh at intel.com> wrote:

> > The below seems fine, but I wonder if we could make this one cause an > > error to be returned later where we can, rather than silently ignoring. > > I'm not sure where or how, though. > > Would it make sense to change wleglwindowresize() so that it return a > value? Either that, or it should be documented somewhere in the API > spec that setting width/height <=0 will be ignored._ _I'm not sure we can change the function signature, it's public stable_ _ABI._ _> > Surely drivers have maximum size limits, too, those must be catched > > somewhere already. But this might be worth looking into: if the window system produces a bad size, what do drivers do when they cannot allocate or render to it? In X11 it's all hidden from the app, but I don't think the gfx stack can guarantee valid sizes in all cases, can it? Anyway, my suggestion is just for convenience, and if drivers already just silently do whatever on a bad size, being silent here does not make it any worse.

We could maybe make it raise an EGL error, I'm a little concerned with how this silently fails. However, the behavior with Sinclairs patch is better than what we had before, so I've pushed that.

Thanks, pq

> > > > > eglwindow->width = width; > > > eglwindow->height = height; > > > eglwindow->dx = dx; > > > @@ -24,6 +27,9 @@ wleglwindowcreate(struct wlsurface *surface, > > > { > > > struct wleglwindow *eglwindow; > > > > > > + if (width <= 0 || height <= 0)_ _> > > + return NULL; > > > + > > > eglwindow = malloc(sizeof *eglwindow); > > > if (!eglwindow) > > > return NULL; > > > > Thanks, > > pq _> > ________________________ > > wayland-devel mailing list > > wayland-devel at lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/wayland-devel >


wayland-devel mailing list wayland-devel at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the dri-devel mailing list