don't needlessly realloc memory
authornotaz <notasas@gmail.com>
Fri, 16 Sep 2011 21:04:15 +0000 (00:04 +0300)
committernotaz <notasas@gmail.com>
Fri, 16 Sep 2011 21:04:15 +0000 (00:04 +0300)
it can potentially fail, mostly if we have multiple overlays
(TV-out and stuff)

src/video/omapdss/osdl_video.c

index fc78001..bc6d9da 100644 (file)
@@ -62,11 +62,13 @@ static int osdl_setup_omapfb(int fd, int enabled, int x, int y, int w, int h, in
                        err_perror("SETUP_PLANE");
        }
 
-       mi.size = mem;
-       ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);
-       if (ret != 0) {
-               err_perror("SETUP_MEM");
-               return -1;
+       if (mi.size < mem) {
+               mi.size = mem;
+               ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);
+               if (ret != 0) {
+                       err_perror("SETUP_MEM");
+                       return -1;
+               }
        }
 
        pi.pos_x = x;