diff mbox series

[FFmpeg-devel,2/2] avcodec/wmalosslessdec: Replace negative channel check by assert

Message ID 20200115002108.25753-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/wmalosslessdec: move channel check up
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Jan. 15, 2020, 12:21 a.m. UTC
It is already checked by common code in git/master

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/wmalosslessdec.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 2b97c2a848..cd7469405d 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -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;