[FFmpeg-cvslog] avcodec/wma,wmaprodec: Remove always-false checks

Andreas Rheinhardt git at videolan.org
Thu Jul 3 21:32:39 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jun 21 03:42:16 2025 +0200| [12777f30a88deefb943b0858b8ab554f5c91b76d] | committer: Andreas Rheinhardt

avcodec/wma,wmaprodec: Remove always-false checks

None of the codecs used here has the AV_CODEC_CAP_CHANNEL_CONF
cap set, so the sample rate is checked generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=12777f30a88deefb943b0858b8ab554f5c91b76d
---

 libavcodec/wma.c       | 2 +-
 libavcodec/wmaprodec.c | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index 257184c0d8..31a422ee27 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -86,7 +86,7 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
     int sample_rate1;
     int coef_vlc_table;
 
-    if (avctx->sample_rate <= 0 || avctx->sample_rate > 50000 ||
+    if (avctx->sample_rate > 50000 ||
         channels           <= 0 || channels    > 2            ||
         avctx->bit_rate    <= 0)
         return -1;
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 44e5da08ab..7f3dc7fd8b 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -471,11 +471,6 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx, int nu
         return AVERROR_INVALIDDATA;
     }
 
-    if (s->avctx->sample_rate <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
-        return AVERROR_INVALIDDATA;
-    }
-
     if (s->nb_channels <= 0) {
         av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
                s->nb_channels);



More information about the ffmpeg-cvslog mailing list