Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ void DecodedBitStreamParser::decodeByteSegment(Ref<BitSource> bits_, string& res
int available = bits.available();
// try to repair count data if count data is invalid
if (count * 8 > available) {
count = (available + 7 / 8);
count = (available + 7) / 8;
}
// avoid reading invalid memory region when no data should be processed
if (count <= 0) return;

ArrayRef<char> bytes_(count);
char* readBytes = &(*bytes_)[0];
Expand Down