40a41,44 > > #define CLAMPMAX(x, max) (((x) > (max)) ? (max) : (x)); > > 262,265c266,269 < info.image_width = mode[i].imageWidth; < info.image_height = mode[i].imageHeight; < info.pixmap_width = mode[i].pixmapWidth; < info.pixmap_height = mode[i].pixmapHeight; --- > info.image_width = CLAMPMAX(mode[i].imageWidth, (CARD16) -1); > info.image_height = CLAMPMAX(mode[i].imageHeight, (CARD16) -1); > info.pixmap_width = CLAMPMAX(mode[i].pixmapWidth, (CARD16) -1); > info.pixmap_height = CLAMPMAX(mode[i].pixmapHeight, (CARD16) -1); 271,276c275,280 < info.viewport_width = mode[i].viewportWidth; < info.viewport_height = mode[i].viewportHeight; < info.viewport_xstep = mode[i].xViewportStep; < info.viewport_ystep = mode[i].yViewportStep; < info.viewport_xmax = mode[i].maxViewportX; < info.viewport_ymax = mode[i].maxViewportY; --- > info.viewport_width = CLAMPMAX(mode[i].viewportWidth, (CARD16) -1); > info.viewport_height = CLAMPMAX(mode[i].viewportHeight, (CARD16) -1); > info.viewport_xstep = CLAMPMAX(mode[i].xViewportStep, (CARD16) -1); > info.viewport_ystep = CLAMPMAX(mode[i].yViewportStep, (CARD16) -1); > info.viewport_xmax = CLAMPMAX(mode[i].maxViewportX, (CARD16) -1); > info.viewport_ymax = CLAMPMAX(mode[i].maxViewportY, (CARD16) -1);