]> granicus.if.org Git - taglib/commitdiff
Fixed a possible out-of-bound access when reading WavPack files
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 18 Sep 2013 19:09:28 +0000 (04:09 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Wed, 18 Sep 2013 19:09:28 +0000 (04:09 +0900)
taglib/wavpack/wavpackproperties.cpp
taglib/wavpack/wavpackproperties.h

index 3f7915443fb00a4bfda8d4fde7f86dac471ee366..085ddf8a4707bcfba30fa8bcd24569a87bd67109 100644 (file)
@@ -126,8 +126,9 @@ TagLib::uint WavPack::Properties::sampleFrames() const
 // private members
 ////////////////////////////////////////////////////////////////////////////////
 
-static const unsigned int sample_rates[] = { 6000, 8000, 9600, 11025, 12000,
-    16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 192000 };
+static const unsigned int sample_rates[] = { 
+   6000,  8000,  9600, 11025, 12000, 16000,  22050, 24000, 
+  32000, 44100, 48000, 64000, 88200, 96000, 192000,     0 };
 
 #define BYTES_STORED    3
 #define MONO_FLAG       4
index bd2209da2099f241ff123c6335dfd90af9ed9011..c788fdd50b1539a6c787f250a794d2181a0e25c8 100644 (file)
@@ -75,7 +75,12 @@ namespace TagLib {
 
       virtual int length() const;
       virtual int bitrate() const;
+
+      /*!
+       * Returns the sample rate in Hz. 0 means unknown or custom.
+       */
       virtual int sampleRate() const;
+      
       virtual int channels() const;
 
       /*!