Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2013-05-18 11:36:05 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2013-05-18 13:55:32 +0400
commit68ec7d28273ca52ec704f753992ae8504f3c0102 (patch)
tree441f894cc0e65c1cb7141022c639c150d28dd73f
parentefbc3891ecdbba61f5eeb88575e020b86c91f0c8 (diff)
riff: don't try to parse too small WAVEFORMAT headerslav0.57
-rw-r--r--libavformat/riff.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 7ad96a8a76..e5b12c3353 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -781,6 +781,12 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
{
int id;
+ /* avoid reading headers which are way too small */
+ if (size < 14) {
+ avio_skip(pb, size);
+ return 0;
+ }
+
id = avio_rl16(pb);
codec->codec_type = AVMEDIA_TYPE_AUDIO;
codec->channels = avio_rl16(pb);