mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
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…
x
Reference in New Issue
Block a user