]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Moved initializations of the pixel_size and attributes fields in the TGA header ealie...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Jan 2008 23:13:27 +0000 (23:13 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 4 Jan 2008 23:13:27 +0000 (23:13 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7904 d7cf8633-e32d-0410-b094-e92efae38249

image.c

diff --git a/image.c b/image.c
index 71cacb6e0b7e25168e61fb647997f5d7114474a0..2146a64758756dbde6d5dc1ad2170f2c4af1aae2 100644 (file)
--- a/image.c
+++ b/image.c
@@ -327,14 +327,15 @@ unsigned char *LoadTGA_BGRA (const unsigned char *f, int filesize)
        targa_header.y_origin = f[10] + f[11] * 256;
        targa_header.width = image_width = f[12] + f[13] * 256;
        targa_header.height = image_height = f[14] + f[15] * 256;
+       targa_header.pixel_size = f[16];
+       targa_header.attributes = f[17];
+
        if (image_width > 4096 || image_height > 4096 || image_width <= 0 || image_height <= 0)
        {
                Con_Print("LoadTGA: invalid size\n");
                PrintTargaHeader(&targa_header);
                return NULL;
        }
-       targa_header.pixel_size = f[16];
-       targa_header.attributes = f[17];
 
        // advance to end of header
        fin = f + 18;