Mesa (9.2): gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa

Ian Romanick idr at kemper.freedesktop.org
Wed Aug 21 22:26:13 UTC 2013


Module: Mesa
Branch: 9.2
Commit: 74fcc65b58f77d61411327f078394d9e44102218
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=74fcc65b58f77d61411327f078394d9e44102218

Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date:   Tue Aug 20 12:35:28 2013 +0200

gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa

Fixes a opengl crash in wine.

Cc: "9.2" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
(cherry picked from commit 86751cbddfa762a6dbd01fd07102ba91bb90b8e5)

---

 src/gallium/state_trackers/osmesa/osmesa.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 9f9d2ad..bb85e5c 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -616,10 +616,11 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
    struct osmesa_buffer *osbuffer;
    enum pipe_format color_format;
 
-   if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) {
+   if (!osmesa || !buffer || width < 1 || height < 1) {
       return GL_FALSE;
    }
-   if (width < 1 || height < 1) {
+
+   if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) {
       return GL_FALSE;
    }
 




More information about the mesa-commit mailing list