mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/dsfdec: check if number of channels is <= 0
Fixes FPE bellow. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
10d48c63b2
commit
d171cd076f
@ -107,6 +107,9 @@ static int dsf_read_header(AVFormatContext *s)
|
|||||||
st->codecpar->channels = avio_rl32(pb);
|
st->codecpar->channels = avio_rl32(pb);
|
||||||
st->codecpar->sample_rate = avio_rl32(pb) / 8;
|
st->codecpar->sample_rate = avio_rl32(pb) / 8;
|
||||||
|
|
||||||
|
if (st->codecpar->channels <= 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
switch(avio_rl32(pb)) {
|
switch(avio_rl32(pb)) {
|
||||||
case 1: st->codecpar->codec_id = AV_CODEC_ID_DSD_LSBF_PLANAR; break;
|
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;
|
case 8: st->codecpar->codec_id = AV_CODEC_ID_DSD_MSBF_PLANAR; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user