X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsoxdec.c;h=35e11feec6da60bb55fae968e68f8d2e1f48a38b;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=12a94c8ffab9603f6708a281b233fda37f4a037e;hpb=8822e2b9543bb02fb2889dff627b6db023053253;p=ffmpeg diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index 12a94c8ffab..35e11feec6d 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -37,7 +37,7 @@ #include "pcm.h" #include "sox.h" -static int sox_probe(AVProbeData *p) +static int sox_probe(const AVProbeData *p) { if (AV_RL32(p->buf) == SOX_TAG || AV_RB32(p->buf) == SOX_TAG) return AVPROBE_SCORE_MAX; @@ -90,7 +90,7 @@ static int sox_read_header(AVFormatContext *s) sample_rate_frac); if ((header_size + 4) & 7 || header_size < SOX_FIXED_HDR + comment_size - || st->codecpar->channels > 65535) /* Reserve top 16 bits */ { + || st->codecpar->channels > 65535 || st->codecpar->channels <= 0) /* Reserve top 16 bits */ { av_log(s, AV_LOG_ERROR, "invalid header\n"); return AVERROR_INVALIDDATA; }