mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 06:38:03 +02:00
verify blit buffer size
This commit is contained in:
parent
499ea3f017
commit
1df3dc0a45
1 changed files with 4 additions and 0 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue