diff options
-rw-r--r-- | src/sna/gen3_render.c | 2 | ||||
-rw-r--r-- | src/sna/sna_video_textured.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 89cd4bd1..7151e125 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3410,6 +3410,8 @@ gen3_render_video(struct sna *sna, DBG(("%s: %dx%d -> %dx%d\n", __FUNCTION__, src_w, src_h, drw_w, drw_h)); dst_bo = sna_pixmap_get_bo(pixmap); + if (dst_bo == NULL) + return FALSE; if (pixmap->drawable.width > 2048 || pixmap->drawable.height > 2048 || diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 8531fc6b..ba0e146c 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -227,6 +227,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, BoxRec dstBox; xf86CrtcPtr crtc; Bool flush = false; + Bool ret; if (!sna_pixmap(pixmap)) return BadAlloc; @@ -265,10 +266,12 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, flush = sna_wait_for_scanline(sna, pixmap, crtc, &clip->extents); - sna->render.video(sna, video, &frame, clip, - src_w, src_h, - drw_w, drw_h, - pixmap); + ret = Success; + if (!sna->render.video(sna, video, &frame, clip, + src_w, src_h, + drw_w, drw_h, + pixmap)) + ret = BadAlloc; kgem_bo_destroy(&sna->kgem, frame.bo); @@ -280,7 +283,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, if (flush) kgem_submit(&sna->kgem); - return Success; + return ret; } static int |