mirror of https://github.com/odrling/Aegisub
Fix overflow issues with truncated pcm files
This commit is contained in:
parent
f811f7e363
commit
bebc024fa0
|
@ -167,7 +167,7 @@ public:
|
||||||
auto chunk_fcc = Read<ChunkId>(&data_left);
|
auto chunk_fcc = Read<ChunkId>(&data_left);
|
||||||
auto chunk_size = Impl::chunk_size(Read<DataSize>(&data_left));
|
auto chunk_size = Impl::chunk_size(Read<DataSize>(&data_left));
|
||||||
|
|
||||||
data_left -= chunk_size;
|
data_left -= std::min(chunk_size, data_left);
|
||||||
|
|
||||||
if (chunk_fcc == Impl::fmt_id()) {
|
if (chunk_fcc == Impl::fmt_id()) {
|
||||||
if (channels || sample_rate || bytes_per_sample)
|
if (channels || sample_rate || bytes_per_sample)
|
||||||
|
|
Loading…
Reference in New Issue