mesa: move assertion after declarations in texstore.c
authorBrian Paul <brianp@vmware.com>
Mon, 16 Feb 2015 15:38:56 +0000 (08:38 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 16 Feb 2015 15:39:25 +0000 (08:39 -0700)
To fix MSVC build.

src/mesa/main/texstore.c

index f25c0d7..7039cdf 100644 (file)
@@ -729,9 +729,9 @@ texstore_rgba(TEXSTORE_PARAMS)
       GLint swapSize = _mesa_sizeof_packed_type(srcType);
       if (swapSize == 2 || swapSize == 4) {
          int bytesPerPixel = _mesa_bytes_per_pixel(srcFormat, srcType);
-         assert(bytesPerPixel % swapSize == 0);
          int swapsPerPixel = bytesPerPixel / swapSize;
          int elementCount = srcWidth * srcHeight * srcDepth;
+         assert(bytesPerPixel % swapSize == 0);
          tempImage = malloc(elementCount * bytesPerPixel);
          if (!tempImage)
             return GL_FALSE;