mirror of https://github.com/odrling/Aegisub
Fix out-of-bounds read when looking for subtitles in a matroska file with no subtitles
This commit is contained in:
parent
c1f968a252
commit
dbec5ff0bc
|
@ -67,6 +67,10 @@ struct MkvStdIO final : InputStream {
|
|||
if (pos == self->file.size())
|
||||
return 0;
|
||||
|
||||
auto remaining = self->file.size() - pos;
|
||||
if (remaining < INT_MAX)
|
||||
count = std::min(static_cast<int>(remaining), count);
|
||||
|
||||
try {
|
||||
memcpy(buffer, self->file.read(pos, count), count);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue