From 13f953aa5e1bd54bb5bc288530054d7c326e90e6 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 17 Sep 2011 00:04:15 +0300 Subject: [PATCH] don't needlessly realloc memory it can potentially fail, mostly if we have multiple overlays (TV-out and stuff) --- src/video/omapdss/osdl_video.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; -- 2.39.5