X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fwestwood_aud.c;h=9c2d35cb8a30456bb8c911cfcc1c7489549241c1;hb=a246fef163387c0d79830a9bdf408443a9aba1c1;hp=4750167f136a2e890c84c3f32769f7aec2a035be;hpb=2c138b2c9b0ec92d9baf704498b1a32a989d03c5;p=ffmpeg diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c index 4750167f136..9c2d35cb8a3 100644 --- a/libavformat/westwood_aud.c +++ b/libavformat/westwood_aud.c @@ -164,6 +164,12 @@ static int wsaud_read_packet(AVFormatContext *s, if (ret != chunk_size) return AVERROR(EIO); + if (st->codecpar->channels <= 0) { + av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", + st->codecpar->channels); + return AVERROR_INVALIDDATA; + } + /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */ pkt->duration = (chunk_size * 2) / st->codecpar->channels; }