verify blit buffer size

This commit is contained in:
Leif Delgass 2002-06-13 00:43:31 +00:00
parent 499ea3f017
commit 1df3dc0a45

View file

@ -468,6 +468,10 @@ static int mach64_dma_dispatch_blit( drm_device_t *dev,
dwords = (blit->width * blit->height) >> dword_shift;
buf->used = dwords << 2;
if ( buf->used <= 0 || buf->used > MACH64_BUFFER_SIZE ) {
DRM_ERROR( "Invalid blit size: %d bytes\n", buf->used );
return -EINVAL;
}
/* FIXME: Use a last buffer flag and reduce the state emitted for subsequent,
* continuation buffers?