diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-20 19:44:46 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-20 19:44:46 +0000 |
commit | 84c327e17f68c4a56fcb76be1f45ab6d35291b5d (patch) | |
tree | d223a6bbab9eed19ef45de25e95eb4f70e7f33ee | |
parent | 4d750219925cb3199ebc6751cdbd2862dfb4cdfe (diff) |
sna/video: Assert that the frame is initialised
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_video.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c index 0a0f1527..ebcf48da 100644 --- a/src/sna/sna_video.c +++ b/src/sna/sna_video.c @@ -246,6 +246,8 @@ sna_video_frame_init(struct sna *sna, frame->VBufOffset = frame->UBufOffset + (int)frame->pitch[0] * height / 2; } + + assert(frame->size); } static void sna_memcpy_plane(struct sna_video *video, @@ -442,13 +444,16 @@ sna_video_copy_data(struct sna *sna, { uint8_t *dst; - DBG(("%s: handle=%d, size=%dx%d, rotation=%d, is-texture=%d\n", + DBG(("%s: handle=%d, size=%dx%d [%d], rotation=%d, is-texture=%d\n", __FUNCTION__, frame->bo ? frame->bo->handle : 0, - frame->width, frame->height, video->rotation, video->textured)); + frame->width, frame->height, frame->size + video->rotation, video->textured)); DBG(("%s: image=(%d, %d), (%d, %d), source=(%d, %d), (%d, %d)\n", __FUNCTION__, frame->image.x1, frame->image.y1, frame->image.x2, frame->image.y2, frame->src.x1, frame->src.y1, frame->src.x2, frame->src.y2)); + assert(frame->width && frame->height); + assert(frame->size); /* In the common case, we can simply the upload in a single pwrite */ if (video->rotation == RR_Rotate_0 && !video->tiled) { |