egl: added cpp assertions/sanity checks
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 20:30:21 +0000 (14:30 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 20:30:21 +0000 (14:30 -0600)
src/gallium/winsys/egl_xlib/sw_winsys.c

index fd0cb9f..28cca9e 100644 (file)
@@ -194,6 +194,8 @@ surface_alloc_storage(struct pipe_winsys *winsys,
    surf->pitch = round_up(width, alignment / surf->cpp);
    surf->usage = flags;
 
+   assert(surf->cpp >= 1);
+   assert(surf->cpp <= 16);
    assert(!surf->buffer);
    surf->buffer = winsys->buffer_create(winsys, alignment,
                                         PIPE_BUFFER_USAGE_PIXEL,