1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-21 03:42:16 +02:00
parent 73646259a0
commit 12777f30a8
2 changed files with 1 additions and 6 deletions

View File

@ -86,7 +86,7 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
int sample_rate1; int sample_rate1;
int coef_vlc_table; int coef_vlc_table;
if (avctx->sample_rate <= 0 || avctx->sample_rate > 50000 || if (avctx->sample_rate > 50000 ||
channels <= 0 || channels > 2 || channels <= 0 || channels > 2 ||
avctx->bit_rate <= 0) avctx->bit_rate <= 0)
return -1; return -1;

View File

@ -471,11 +471,6 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx, int nu
return AVERROR_INVALIDDATA; 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) { if (s->nb_channels <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n", av_log(avctx, AV_LOG_ERROR, "invalid number of channels %d\n",
s->nb_channels); s->nb_channels);