diff options
-rw-r--r-- | src/sna/sna.h | 2 | ||||
-rw-r--r-- | src/sna/sna_video_textured.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index 6f726981..185bc1de 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -479,7 +479,7 @@ sna_drawable_move_to_gpu(DrawablePtr drawable, unsigned flags) static inline Bool sna_pixmap_is_gpu(PixmapPtr pixmap) { - struct sna_pixmap *priv = sna_pixmap(pixmap); + struct sna_pixmap *priv = pixmap ? sna_pixmap(pixmap) : NULL; return priv && priv->gpu_bo; } diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index ba0e146c..a72d3351 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -229,7 +229,10 @@ sna_video_textured_put_image(ScrnInfoPtr scrn, Bool flush = false; Bool ret; - if (!sna_pixmap(pixmap)) + if (buf == 0) + return BadAlloc; + + if (!sna_pixmap_is_gpu(pixmap)) return BadAlloc; sna_video_frame_init(sna, video, id, width, height, &frame); |