[U-Boot] [PATCH 2/4] gdsys: osd: Allow osdsize on valid screens only

dirk.eibach at gdsys.cc dirk.eibach at gdsys.cc
Thu Jun 2 09:05:40 CEST 2016


From: Dirk Eibach <dirk.eibach at gdsys.cc>

Limit "osdsize"-command to access valid screens only.

Signed-off-by: Dirk Eibach <dirk.eibach at gdsys.cc>
---

 board/gdsys/common/osd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 4e292f5..add9574 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -469,6 +469,9 @@ int osd_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	}
 
 	for (screen = 0; screen < MAX_OSD_SCREEN; ++screen) {
+		if (!(osd_screen_mask & (1 << screen)))
+			continue;
+
 		OSD_SET_REG(screen, xy_size, ((x - 1) << 8) | (y - 1));
 		OSD_SET_REG(screen, x_pos, 32767 * (640 - 12 * x) / 65535);
 		OSD_SET_REG(screen, y_pos, 32767 * (480 - 18 * y) / 65535);
-- 
2.1.3



More information about the U-Boot mailing list