diff --git a/src/bitvis.cpp b/src/bitvis.cpp index 423d60d..bf4c88a 100644 --- a/src/bitvis.cpp +++ b/src/bitvis.cpp @@ -410,7 +410,7 @@ void CBitVis::InitChars() {\ const unsigned int* pixarr = pixels;\ std::vector pixelvec;\ - int charheight = CharHeight(pixarr);\ + int charheight = CharHeight(pixarr, sizeof(pixels));\ if (m_fontheight < charheight)\ m_fontheight = charheight;\ for (size_t i = 0; i < sizeof(pixels) / sizeof(pixels[0]); i++)\ @@ -517,10 +517,10 @@ void CBitVis::InitChars() GLYPH(' ', ((const unsigned int[]){0x0, 0x0, 0x0})) } -int CBitVis::CharHeight(const unsigned int* in) +int CBitVis::CharHeight(const unsigned int* in, size_t size) { int highest = 0; - for (int i = 0; i < 8; i++) + for (size_t i = 0; i < size; i++) { for (int j = 0; j < 32; j++) { diff --git a/src/bitvis.h b/src/bitvis.h index 5e2b400..4b134c2 100644 --- a/src/bitvis.h +++ b/src/bitvis.h @@ -73,7 +73,7 @@ class CBitVis void ProcessAudio(); void SendData(int64_t time); void SetText(uint8_t* buff, const char* str, int offset = 0); - int CharHeight(const unsigned int* in); + int CharHeight(const unsigned int* in, size_t size); void InitChars(); static void JackError(const char* jackerror); static void JackInfo(const char* jackinfo);