Fix crash when passing a long string to v.drawString
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2403
This commit is contained in:
1 parent
4c45b9fb85
commit
298f8ef842
1 file changed
+2
-1
@@ -165,7 +165,8 @@ static size_t CopyString(huddrawlist_h list, const char* str)
|
||||
if (list->strbuf_capacity <= list->strbuf_len + lenstr + 1)
|
||||
{
|
||||
if (list->strbuf_capacity == 0) list->strbuf_capacity = 256;
|
||||
else list->strbuf_capacity *= 2;
|
||||
while (list->strbuf_capacity <= list->strbuf_len + lenstr + 1)
|
||||
list->strbuf_capacity *= 2;
|
||||
list->strbuf = (char*) Z_Realloc(list->strbuf, sizeof(char) * list->strbuf_capacity, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user