diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-04-30 17:50:22 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-04-30 17:50:22 +0200 |
commit | d171cd076f611b70a9d2e08bc261b470affcb932 (patch) | |
tree | b87112bac49ec8be4cb1717a81515f3ba124becd /libavformat/dsfdec.c | |
parent | 10d48c63b2a7e2f929eb9c56e3012dd2d7334925 (diff) | |
download | ffmpeg-d171cd076f611b70a9d2e08bc261b470affcb932.tar.gz |
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.c | 3 |
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; |