From: notaz Date: Fri, 16 Sep 2011 21:04:15 +0000 (+0300) Subject: don't needlessly realloc memory X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13f953aa5e1bd54bb5bc288530054d7c326e90e6;p=sdl_omap.git don't needlessly realloc memory it can potentially fail, mostly if we have multiple overlays (TV-out and stuff) --- diff --git a/src/video/omapdss/osdl_video.c b/src/video/omapdss/osdl_video.c index fc78001..bc6d9da 100644 --- a/src/video/omapdss/osdl_video.c +++ b/src/video/omapdss/osdl_video.c @@ -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;