summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-25 21:01:35 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-25 21:01:35 +0000
commitc5c20ae4367905f0cf3080d46aa3bed3806134b9 (patch)
tree1180e41e84b088ccda91a9a76da96b6207fa2faf /libavcodec/wmaprodec.c
parentab379c671f0df211a173cff3a66a1341c162c6e5 (diff)
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
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 2a597b47ce..922b75beff 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -343,9 +343,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
}
- if (s->num_channels < 0 || s->num_channels > WMAPRO_MAX_CHANNELS) {
- av_log_ask_for_sample(avctx, "invalid number of channels\n");
- return AVERROR_NOTSUPP;
+ if (s->num_channels < 0) {
+ av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n", s->num_channels);
+ 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,