diff mbox series

[FFmpeg-devel] avformat/movenc: Make check actually check what is intended

Message ID AS8P250MB0744F29BB1EFF5535E18B7608F502@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel] avformat/movenc: Make check actually check what is intended | expand

Checks

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 Feb. 20, 2024, 5:49 p.m. UTC
Also fixes a Clang warning:
"overlapping comparisons always evaluate to false
[-Wtautological-overlap-compare]"

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index afcee683cd..0855c4bb48 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7160,7 +7160,7 @@  static int mov_init_iamf_track(AVFormatContext *s)
     if (!nb_audio_elements && !nb_mix_presentations)
         return 0;
 
-    if ((nb_audio_elements < 1 && nb_audio_elements > 2) || nb_mix_presentations < 1) {
+    if ((nb_audio_elements < 1 || nb_audio_elements > 2) || nb_mix_presentations < 1) {
         av_log(s, AV_LOG_ERROR, "There must be >= 1 and <= 2 IAMF_AUDIO_ELEMENT and at least "
                                 "one IAMF_MIX_PRESENTATION stream groups to write a IMAF track\n");
         return AVERROR(EINVAL);