diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-08 01:41:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-08 01:41:20 +0200 |
commit | 8d14e1d64ee1780f839e05c22fc633b3cf1b8579 (patch) | |
tree | 9a2259418c83ee5f4397f0fc921b52e45f817269 /libavformat/riff.c | |
parent | 5da68aff96ff77b0f82d80f250e23c2f3696938b (diff) | |
parent | 7e350b7ddd19af856b55634233d609e29baab646 (diff) | |
download | ffmpeg-8d14e1d64ee1780f839e05c22fc633b3cf1b8579.tar.gz |
Merge commit '7e350b7ddd19af856b55634233d609e29baab646' into release/1.1
* commit '7e350b7ddd19af856b55634233d609e29baab646':
pcx: Check the packet size before assuming it fits a palette
rpza: Fix a buffer size check
xxan: Disallow odd width
xan: Only read within the data that actually was initialized
xan: Use bytestream2 to limit reading to within the buffer
pcx: Consume the whole packet if giving up due to missing palette
pngdec: Stop trying to decode once inflate returns Z_STREAM_END
mov: Make sure the read sample count is nonnegative
bfi: Add some very basic sanity checks for input packet sizes
bfi: Avoid divisions by zero
electronicarts: Add more sanity checking for the number of channels
riffdec: Add sanity checks for the sample rate
Conflicts:
libavcodec/pcx.c
libavcodec/xan.c
libavformat/mov.c
libavformat/riff.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r-- | libavformat/riff.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index b417e2e594..02bf1e5962 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -736,6 +736,11 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) if (size > 0) avio_skip(pb, size); } + if (codec->sample_rate <= 0) { + av_log(NULL, AV_LOG_ERROR, + "Invalid sample rate: %d\n", codec->sample_rate); + return AVERROR_INVALIDDATA; + } if (codec->codec_id == AV_CODEC_ID_AAC_LATM) { /* channels and sample_rate values are those prior to applying SBR and/or PS */ codec->channels = 0; |