Skip to content

Commit 1e20eed

Browse files
Correct buffer length calculation in dumpSourceBytes (shader-slang#6593)
No functional change as overallocating was ok, but this was wrong Co-authored-by: Yong He <yonghe@outlook.com>
1 parent 395302d commit 1e20eed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/core/slang-hex-dump-util.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ SlangResult HexDumpUtil::dumpSourceBytes(
7979

8080
// each byte is output as "0xAA, "
8181
// Ends with '\n"
82-
const size_t lineBytes = count * (4 + 1 + 1) * count + 1;
82+
const size_t lineBytes = count * 6 + 1;
8383

8484
char* startDst = writer->beginAppendBuffer(lineBytes);
8585
char* dst = startDst;

0 commit comments

Comments
 (0)