From: Daniel Lehman dlehman25@gmail.com
--- dlls/glu32/mipmap.c | 5 +++++ dlls/glu32/tests/glu.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/glu32/mipmap.c b/dlls/glu32/mipmap.c index 6877e2f342c..4a324f45e70 100644 --- a/dlls/glu32/mipmap.c +++ b/dlls/glu32/mipmap.c @@ -37,6 +37,7 @@
#include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "wine/wgl.h" #include "wine/glu.h"
@@ -3452,6 +3453,10 @@ GLint WINAPI gluScaleImage( GLenum format, GLint widthin, GLint heightin, GLenum if (!isLegalFormatForPackedPixelType(format, typeout)) { return GLU_INVALID_OPERATION; } + if (!wglGetCurrentContext()) { + return GL_OUT_OF_MEMORY; /* windows returns this if no gl context (not glu error) */ + } + beforeImage = HeapAlloc(GetProcessHeap(), 0, image_size(widthin, heightin, format, GL_UNSIGNED_SHORT)); afterImage = diff --git a/dlls/glu32/tests/glu.c b/dlls/glu32/tests/glu.c index 698976d3bd0..4e9931141fb 100644 --- a/dlls/glu32/tests/glu.c +++ b/dlls/glu32/tests/glu.c @@ -40,12 +40,9 @@ static void test_gluScaleImage(HDC hdc, HGLRC hglrc) /* test without any context */ wglMakeCurrent(hdc, 0);
- /* test crashes on Wine */ - if (!winetest_platform_is_wine) { err = gluScaleImage(GL_RGBA, DIMIN, DIMIN, GL_UNSIGNED_BYTE, bufin, DIMOUT, DIMOUT, GL_UNSIGNED_BYTE, bufout); ok(err == GL_OUT_OF_MEMORY, "got %x\n", err); - }
/* test with context */ wglMakeCurrent(hdc, hglrc);