X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglu%2Fsgi%2Flibutil%2Fmipmap.c;h=71e76afb8720ebe7652830e70b6910ddf84bd91a;hb=d34ddad9a5260937e3ad5fc0b945f3195d7e032e;hp=c5faebd6a35f963303df26332d3e2acc325fb61a;hpb=4dcdf3b9c67f1481d46c1decba84c9c55698db4c;p=mesa.git diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index c5faebd6a35..71e76afb872 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -36,7 +36,6 @@ #include #include /* UINT_MAX */ #include -#include "gluint.h" typedef union { unsigned char ub[4]; @@ -3608,6 +3607,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(newImage); return GLU_OUT_OF_MEMORY; } } @@ -4107,6 +4107,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ @@ -4349,6 +4350,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } } @@ -5550,7 +5552,7 @@ static void shove233rev(const GLfloat shoveComponents[], static void extract565(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); @@ -5591,7 +5593,7 @@ static void shove565(const GLfloat shoveComponents[], static void extract565rev(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); @@ -6629,7 +6631,7 @@ static TexImage3Dproc pTexImage3D = 0; # include # include #else - WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR); +# include #endif static void gluTexImage3D( GLenum target, GLint level, @@ -8098,6 +8100,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ @@ -8232,6 +8235,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } }