From ce55a3a22429926fa5e0e6c21c46d3648824f709 Mon Sep 17 00:00:00 2001 From: wro Date: Tue, 12 Sep 2023 11:28:03 +0200 Subject: [PATCH 1/2] Use 32bit integer to enforce byte alignment Previously, 0xfffffe was used to discard the 1-bit while seeking through a wav source. This causes issues for files with very large data chunks. --- audiostream/src/ni/media/audio/wav/wav_source.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiostream/src/ni/media/audio/wav/wav_source.h b/audiostream/src/ni/media/audio/wav/wav_source.h index bd3e10ed..8aeeb6a8 100644 --- a/audiostream/src/ni/media/audio/wav/wav_source.h +++ b/audiostream/src/ni/media/audio/wav/wav_source.h @@ -203,7 +203,7 @@ auto readWavHeader( Source& src ) } } - src.seek( ( currentOffset + riffTag.length + 1 ) & 0xfffffe, std::ios_base::beg ); + src.seek( ( currentOffset + riffTag.length + 1 ) & 0xfffffffe, std::ios_base::beg ); } throw std::runtime_error( "Could not read \'data\' tag." ); From c7b0e9e2cf979241376b8bf2cc36eec51330d766 Mon Sep 17 00:00:00 2001 From: Moritz Heppner Date: Mon, 18 Sep 2023 12:21:09 +0200 Subject: [PATCH 2/2] audiostream tests: replace invalid fuzz file context: the file header was reporting a very large size, which was unintended and previously shadowed by a bug in wav_source.h --- audiostream/test/test_files/fuzz_files/21.wav | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiostream/test/test_files/fuzz_files/21.wav b/audiostream/test/test_files/fuzz_files/21.wav index a30003a9..23961d07 100644 --- a/audiostream/test/test_files/fuzz_files/21.wav +++ b/audiostream/test/test_files/fuzz_files/21.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b16269641b70f33dce790647b7aeab40b6a73f6d651ae7d9aabb53df9a89650 +oid sha256:61f1d2619a98bc2a753cf24e09eca80d45bbf14546159e8d6bce2dbac7e85537 size 44