diff options
author | Maarten Lankhorst <[email protected]> | 2013-08-20 12:35:28 +0200 |
---|---|---|
committer | Maarten Lankhorst <[email protected]> | 2013-08-20 12:36:17 +0200 |
commit | 86751cbddfa762a6dbd01fd07102ba91bb90b8e5 (patch) | |
tree | 23284ab77e16819858d1edf4a310e5296b7d79b5 /src | |
parent | 603160d4c0ff3b5ec594aed4ee7f8e161626946d (diff) |
gallium/osmesa: add same checks to OSMesaMakeCurrent as the other osmesa
Fixes a opengl crash in wine.
Cc: "9.2" <[email protected]>
Signed-off-by: Maarten Lankhorst <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | 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 9f9d2ad033c..bb85e5c2f0c 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; } |