changeset 11540:6e1a61e42561 libavcodec

Make wmaprodec.c:decode_init() return AVERROR_INVALIDDATA / AVERROR_PATCHWELCOME in case of invalid / unsupported number of channels specified, rather than return AVERROR_NOTSUPP.
author stefano
date Thu, 25 Mar 2010 21:01:35 +0000
parents afe2ac7b175c
children a3790cd1c9ca
files wmaprodec.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wmaprodec.c	Thu Mar 25 19:39:06 2010 +0000
+++ b/wmaprodec.c	Thu Mar 25 21:01:35 2010 +0000
@@ -343,9 +343,12 @@
         }
     }
 
-    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,