diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 926a062c2..35f86b8c7 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -1444,6 +1444,7 @@ void eval_l25() #endif APx0 = APy0 = APx = APy = tAPx = tAPy = 0; eval_object(13 * (23-2 + 2), tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage], &APx, &APy, &APx0, &APy0, OBJ_ACTIVE, &page_char[40]); /* 1st triplet p26/0 */ + tuxtxt_clear_p26(pi->ext); } { diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index 52a4fedba..a02125b81 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -61,6 +61,7 @@ extern void tuxtxt_decode_btt(); extern void tuxtxt_decode_adip(); /* additional information table */ extern void tuxtxt_compress_page(int p, int sp, unsigned char* buffer); extern void tuxtxt_decompress_page(int p, int sp, unsigned char* buffer); +extern void tuxtxt_clear_p26(tstExtData* extData); #if TUXTXT_DEBUG extern int tuxtxt_get_zipsize(int p, int sp); #endif diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 783c485d8..6607b589e 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -520,6 +520,21 @@ void tuxtxt_erase_page(int magazine) } } +void tuxtxt_clear_p26(tstExtData* extData) +{ + pthread_mutex_lock(&tuxtxt_cache_lock); + + for(int i = 0; i < 16; ++i) + { + if(0 != extData->p26[i]) + { + memset(extData->p26[i], 0x00, 13 * 3); + } + } + + pthread_mutex_unlock(&tuxtxt_cache_lock); +} + void tuxtxt_allocate_cache(int magazine) { // Lock here as we have a possible race here with