eina_tiler: use int size matching Eina_Rectangle internally to avoid overflow
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 21 Apr 2017 20:14:57 +0000 (16:14 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 21 Apr 2017 20:16:12 +0000 (16:16 -0400)
since this code's creation it seems that the internal int size was set to use
short in order to micro-optimize memory usage, while the api function parameters
used Eina_Rectangle which had a larger int size. when initializing the internal
rect struct, this would lead to overflows which resulted in broken tilers which
returned iterators with no valid rects after having valid rects added

test case: run weston-subsurfaces

@fix

src/lib/eina/eina_tiler.c

index 938bca7..fa9a092 100644 (file)
@@ -58,12 +58,12 @@ struct list
 
 struct rect
 {
-   short right;
-   short bottom;
-   short left;
-   short top;
-   short width;
-   short height;
+   int right;
+   int bottom;
+   int left;
+   int top;
+   int width;
+   int height;
    int area;
 };