From ac98b53f05bb2bc7694df34c6bfb2476a3ca0a87 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 2 Jan 2016 11:31:40 +0100 Subject: [PATCH] tuxtxt: fix rare crash / memory corruption cache manipulation outside locks is evil, and the variables have been initialized in tuxtxt_init earlier anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/aab075bd705e8a0b9865d113668e4bf777a58361 Author: Stefan Seyfried Date: 2016-01-02 (Sat, 02 Jan 2016) ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 459d386d0..b26e48e37 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -1920,7 +1920,6 @@ static int oldfontheight = 0; int Init(int source) { int error, i; - unsigned char magazine; static std::string font_file; /* init data */ @@ -1928,12 +1927,13 @@ int Init(int source) //page_atrb[32] = transp<<4 | transp; inputcounter = 2; +#if TUXTXT_CFG_STANDALONE + unsigned char magazine; for (magazine = 1; magazine < 9; magazine++) { tuxtxt_cache.current_page [magazine] = -1; tuxtxt_cache.current_subpage [magazine] = -1; } -#if TUXTXT_CFG_STANDALONE /* init data */ memset(&tuxtxt_cache.astCachetable, 0, sizeof(tuxtxt_cache.astCachetable)); memset(&tuxtxt_cache.subpagetable, 0xFF, sizeof(tuxtxt_cache.subpagetable));