From 6771de1f2d13401ab88b7e4ac5bd4d973a36558d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 Jun 2017 11:53:59 +0200 Subject: [PATCH] lib/libtuxtxt/tuxtxt.cpp avoid segfault, FIXME Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7aec84d124b6040deaa306d6980ffdc7463784e8 Author: Jacek Jendrzej Date: 2017-06-26 (Mon, 26 Jun 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 714494681..d5d093a6a 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -58,6 +58,10 @@ fb_pixel_t *getFBp(int *y) void FillRect(int x, int y, int w, int h, int color) { + if(color < 0 || SIZECOLTABLE < color){ + printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); + return; + } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride;