We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a178510 commit db654efCopy full SHA for db654ef
sbe-tool/src/main/cpp/otf/IrDecoder.h
@@ -53,9 +53,17 @@ class IrDecoder
53
{
54
}
55
56
- int decode(char *buffer, std::uint64_t length)
+ int decode(char *irBuffer, std::uint64_t length)
57
58
m_length = length;
59
+ if (m_length == 0)
60
+ {
61
+ return -1;
62
+ }
63
+ std::unique_ptr<char[]> buffer(new char[m_length]);
64
+ m_buffer = std::move(buffer);
65
+ std::memcpy(m_buffer.get(), irBuffer, m_length);
66
+
67
return decodeIr();
68
69
@@ -81,7 +89,7 @@ class IrDecoder
81
89
return -1;
82
90
83
91
84
- return decode(m_buffer.get(), m_length);
92
+ return decodeIr();
85
93
86
94
87
95
std::shared_ptr<std::vector<Token>> header()
0 commit comments