From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yeh, Sinclair" Subject: Re: [PATCH] Prevent zero sized wl_egl_window Date: Thu, 13 Feb 2014 18:18:23 +0000 Message-ID: <1392315418.3247.29.camel@syeh2-linux1.fm.intel.com> References: <1392250871-3224-1-git-send-email-sinclair.yeh@intel.com> <20140213101109.5bf7cb74@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140213101109.5bf7cb74@gmail.com> Content-Language: en-US Content-ID: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Pekka Paalanen Cc: "dri-devel@lists.freedesktop.org" , "wayland-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org > 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 wl_egl_window_resize() 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. > > Surely drivers have maximum size limits, too, those must be catched > somewhere already. > > > egl_window->width = width; > > egl_window->height = height; > > egl_window->dx = dx; > > @@ -24,6 +27,9 @@ wl_egl_window_create(struct wl_surface *surface, > > { > > struct wl_egl_window *egl_window; > > > > + if (width <= 0 || height <= 0) > > + return NULL; > > + > > egl_window = malloc(sizeof *egl_window); > > if (!egl_window) > > return NULL; > > Thanks, > pq > _______________________________________________ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel