diff mbox series

[FFmpeg-devel,08/17] avcodec/pcm: Remove always-false check

Message ID GV1P250MB0737A18572C4E5E36C32F05C8F4A9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 5c18934c6d8bb56e412efc5636fbc22b6c57b16d
Headers show
Series [FFmpeg-devel,01/17] avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 18, 2022, 8:27 p.m. UTC
None of the decoders here have the AV_CODEC_CAP_CHANNEL_CONF set,
so that it is already checked generically that the number of channels
is positive.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavcodec/pcm.c | 5 -----
 1 file changed, 5 deletions(-)
diff mbox series


diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index fcb8ae1c2c..ee36a364c8 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -254,11 +254,6 @@  static av_cold int pcm_decode_init(AVCodecContext *avctx)
     AVFloatDSPContext *fdsp;
     int i;
-    if (avctx->ch_layout.nb_channels <= 0) {
-        av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
-        return AVERROR(EINVAL);
-    }
     switch (avctx->codec_id) {
         for (i = 0; i < 256; i++)