Skip to content

Commit

Permalink
Merge branch 'adamstark:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ascii255 authored Apr 24, 2023
2 parents 722d3b7 + 2a96219 commit 8edc6ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion AudioFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,13 @@ int AudioFile<T>::getIndexOfChunk (const std::vector<uint8_t>& source, const std
if ((i + 4) >= source.size())
return -1;

auto chunkSize = fourBytesToInt (source, i, endianness);
int32_t chunkSize = fourBytesToInt (source, i, endianness);
// Assume chunk size is invalid if it's greater than the number of bytes remaining in source
if (chunkSize > (source.size() - i - dataLen) || (chunkSize < 0))
{
assert (false && "Invalid chunk size");
return -1;
}
i += (dataLen + chunkSize);
}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ Many thanks to the following people for their contributions to this library:
* [emiro85](https://github.com/emiro85)
* [heartofrain](https://github.com/heartofrain)
* [helloimmatt](https://github.com/helloimmatt/)
* [leocstone](https://github.com/leocstone)
* [MatthieuHernandez](https://github.com/MatthieuHernandez)
* [mrpossoms](https://github.com/mrpossoms)
* [mynameisjohn](https://github.com/mynameisjohn)
Expand Down

0 comments on commit 8edc6ae

Please sign in to comment.