avcodec/wmalosslessdec: Replace negative channel check by assert
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Jan 2020 23:46:53 +0000 (00:46 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 15 Jan 2020 12:49:13 +0000 (13:49 +0100)
It is already checked by common code in git/master

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/wmalosslessdec.c

index 2b97c2a..cd74694 100644 (file)
@@ -189,11 +189,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return AVERROR(EINVAL);
     }
 
-    if (avctx->channels < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
-               avctx->channels);
-        return AVERROR_INVALIDDATA;
-    } else if (avctx->channels > WMALL_MAX_CHANNELS) {
+    av_assert0(avctx->channels >= 0);
+    if (avctx->channels > WMALL_MAX_CHANNELS) {
         avpriv_request_sample(avctx,
                               "More than %d channels", WMALL_MAX_CHANNELS);
         return AVERROR_PATCHWELCOME;