Commit c5c20ae4 authored by Stefano Sabatini's avatar Stefano Sabatini

Make wmaprodec.c:decode_init() return AVERROR_INVALIDDATA /

AVERROR_PATCHWELCOME in case of invalid / unsupported number of
channels specified, rather than return AVERROR_NOTSUPP.

Originally committed as revision 22674 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent ab379c67
...@@ -343,9 +343,12 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -343,9 +343,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
} }
} }
if (s->num_channels < 0 || s->num_channels > WMAPRO_MAX_CHANNELS) { if (s->num_channels < 0) {
av_log_ask_for_sample(avctx, "invalid number of channels\n"); av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n", s->num_channels);
return AVERROR_NOTSUPP; return AVERROR_INVALIDDATA;
} else if (s->num_channels > WMAPRO_MAX_CHANNELS) {
av_log_ask_for_sample(avctx, "unsupported number of channels\n");
return AVERROR_PATCHWELCOME;
} }
INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment