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

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-04-30 18:50:22 +0300
committerPaul B Mahol <onemda@gmail.com>2016-04-30 18:50:22 +0300
commitd171cd076f611b70a9d2e08bc261b470affcb932 (patch)
treeb87112bac49ec8be4cb1717a81515f3ba124becd /libavformat/dsfdec.c
parent10d48c63b2a7e2f929eb9c56e3012dd2d7334925 (diff)
avformat/dsfdec: check if number of channels is <= 0
Fixes FPE bellow. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/dsfdec.c')
-rw-r--r--libavformat/dsfdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/dsfdec.c b/libavformat/dsfdec.c
index beb2fbf5aa..a8c78e4a4d 100644
--- a/libavformat/dsfdec.c
+++ b/libavformat/dsfdec.c
@@ -107,6 +107,9 @@ static int dsf_read_header(AVFormatContext *s)
st->codecpar->channels = avio_rl32(pb);
st->codecpar->sample_rate = avio_rl32(pb) / 8;
+ if (st->codecpar->channels <= 0)
+ return AVERROR_INVALIDDATA;
+
switch(avio_rl32(pb)) {
case 1: st->codecpar->codec_id = AV_CODEC_ID_DSD_LSBF_PLANAR; break;
case 8: st->codecpar->codec_id = AV_CODEC_ID_DSD_MSBF_PLANAR; break;