diff options
author | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2013-09-19 04:09:28 +0900 |
---|---|---|
committer | Tsuda Kageyu <tsuda.kageyu@gmail.com> | 2013-09-19 04:09:28 +0900 |
commit | e125bcb78b3c7da0dc8cb30b35b0540af3114125 (patch) | |
tree | 62639950905798c6b7b80a9b3200f3f71288650c /taglib/wavpack | |
parent | c12b6697f97635dfe460fbaeaad008fdd6e05221 (diff) |
Fixed a possible out-of-bound access when reading WavPack files
Diffstat (limited to 'taglib/wavpack')
-rw-r--r-- | taglib/wavpack/wavpackproperties.cpp | 5 | ||||
-rw-r--r-- | taglib/wavpack/wavpackproperties.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/taglib/wavpack/wavpackproperties.cpp b/taglib/wavpack/wavpackproperties.cpp index 3f791544..085ddf8a 100644 --- a/taglib/wavpack/wavpackproperties.cpp +++ b/taglib/wavpack/wavpackproperties.cpp @@ -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 diff --git a/taglib/wavpack/wavpackproperties.h b/taglib/wavpack/wavpackproperties.h index bd2209da..c788fdd5 100644 --- a/taglib/wavpack/wavpackproperties.h +++ b/taglib/wavpack/wavpackproperties.h @@ -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; /*! |