fixt
authorken <ken@mihrtec.com>
Fri, 17 Feb 2017 00:50:07 +0000 (16:50 -0800)
committerken <ken@mihrtec.com>
Fri, 17 Feb 2017 00:50:07 +0000 (16:50 -0800)
src/binaryout.c

index ffb4021..94f8c29 100644 (file)
@@ -838,29 +838,18 @@ bin_process_pixel
   int init_height,
   int init_width
 )
-{ struct bin_pixel_node_t* pixel_node;
-
-
-  pixel_node = struct_alloc(bin_pixel_node_t);
-
-  if(data)
-    { /* get ref from 4 bytes of data */
+{ struct bin_pixel_node_t* pixel_node = NULL;
+  if(*data)
+    { pixel_node = struct_alloc(bin_pixel_node_t);
+      /* get ref from 4 bytes of data */  
       pixel_node->data.ref = (int) data;
       /* bitshift by ? to get Z */
       pixel_node->data.z = ((int) data << 24);
-
       /* set x and y */
       pixel_node->data.x = x + init_width ;
       pixel_node->data.y = y + init_width;
-      data += 4;
     }
-  else
-    { data += 4; //TODO: does this correctly increment past 0x00000000?
-      return NULL;
-    }
-  
-  
-
+  *data += 4;
   return pixel_node;
       
 }