Skip to content

Commit

Permalink
[Audio/WavLoad] Fixed skipping of unsupported chunks
Browse files Browse the repository at this point in the history
- The condition was reversed and fields with at least one matching character with "data" were used
  • Loading branch information
Razakhel committed Feb 18, 2025
1 parent 33d891b commit 5b77b55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RaZ/Data/WavLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ inline WavInfo validateWav(std::ifstream& file) {
// - https://en.wikipedia.org/wiki/WAV#RIFF_WAVE
// - https://en.wikipedia.org/wiki/Broadcast_Wave_Format#Details
// - https://stackoverflow.com/a/76137824/3292304
while (bytes[0] != 'd' && bytes[1] != 'a' && bytes[2] != 't' && bytes[3] != 'a') {
while (bytes[0] != 'd' || bytes[1] != 'a' || bytes[2] != 't' || bytes[3] != 'a') {
file.read(reinterpret_cast<char*>(bytes.data()), 4); // Reading the chunk size

const uint32_t chunkSize = fromLittleEndian(bytes);
Expand Down

0 comments on commit 5b77b55

Please sign in to comment.