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 fd0cb9fb12b97dee3d8c8687a95c79f2b96f75bc..28cca9e581f5fbb614643364b19926f090b2ddab 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,