mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Handle invalid UTF-8 bytes without infinite loop
This commit is contained in:
@@ -923,6 +923,13 @@ void formatargument(char type, void *rawarg, FormatterParams formatter, char *&o
|
||||
// skip past continuation bytes (if we hit a NULL terminator this loop will break out)
|
||||
while((*si & 0xC0) == 0x80) si++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// invalid UTF-8 byte to encounter, bail out here.
|
||||
clipoffs = 0;
|
||||
len = 0;
|
||||
s = "";
|
||||
}
|
||||
|
||||
len++; // one more codepoint
|
||||
if(len == precision && formatter.Precision != FormatterParams::NoPrecision)
|
||||
|
||||
Reference in New Issue
Block a user