summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2013-03-20 19:45:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-22 17:50:22 +0100
commitd64a68f5c8386e82fe9aa5e8eaf94f78124602f5 (patch)
treec463eacfd53f9a11935758f75964f1a5b659af6d /tests
parent5ffe8bd6d93d78b4f258a34c15cde2f9155efb09 (diff)
Fix calculation bug in QWaveDecoder.
When comparing the size of the WaveHeader and the chunk size, we need to include the ID and Size fields, or any extra data won't be discarded and the parsing will fail. Change-Id: I730833f33f57b26cd750985354136191f7e7ce04 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wavbin0 -> 22096 bytes
-rw-r--r--tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp2
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav b/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
new file mode 100644
index 000000000..087e68e82
--- /dev/null
+++ b/tests/auto/unit/qwavedecoder/data/isawav_1_16_44100_le_2.wav
Binary files differ
diff --git a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
index c74fb51ae..494737223 100644
--- a/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
+++ b/tests/auto/unit/qwavedecoder/tst_qwavedecoder.cpp
@@ -130,6 +130,8 @@ void tst_QWaveDecoder::file_data()
QTest::newRow("File isawav_1_16_44100_le.wav") << testFilePath("isawav_1_16_44100_le.wav") << tst_QWaveDecoder::None << 1 << 16 << 44100 << QAudioFormat::LittleEndian;
QTest::newRow("File isawav_2_16_8000_be.wav") << testFilePath("isawav_2_16_8000_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 8000 << QAudioFormat::BigEndian;
QTest::newRow("File isawav_2_16_44100_be.wav") << testFilePath("isawav_2_16_44100_be.wav") << tst_QWaveDecoder::None << 2 << 16 << 44100 << QAudioFormat::BigEndian;
+ // The next file has extra data in the wave header.
+ QTest::newRow("File isawav_1_16_44100_le_2.wav") << testFilePath("isawav_1_16_44100_le_2.wav") << tst_QWaveDecoder::None << 1 << 16 << 44100 << QAudioFormat::LittleEndian;
// 32 bit waves are not supported
QTest::newRow("File isawav_1_32_8000_le.wav") << testFilePath("isawav_1_32_8000_le.wav") << tst_QWaveDecoder::FormatDescriptor << 1 << 32 << 8000 << QAudioFormat::LittleEndian;