[FFmpeg-cvslog] avcodec/acelp_vectors: Add missing brackets

Andreas Rheinhardt git at videolan.org
Sat Aug 7 22:52:28 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Aug  6 18:10:19 2021 +0200| [127da193d4935b44dc70e0fe0c342f7d35908180] | committer: Andreas Rheinhardt

avcodec/acelp_vectors: Add missing brackets

Before 3793caa5e2d1d16ed45771574b2ffc932497cfcf the code was
"if (...) do { ... } while (...);". After said commit this became
"if (...) av_assert0(...); do { ... } while (...);", i.e. the loop
is always executed. This commit changes the logic to what it was before
said commit. Notice that the condition is always true in FATE, so no
changes are necessary there.

This fixes a -Wmisleading-indentation warning from GCC 11.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/acelp_vectors.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/acelp_vectors.c b/libavcodec/acelp_vectors.c
index 0d4de0e4c3..8adea683c1 100644
--- a/libavcodec/acelp_vectors.c
+++ b/libavcodec/acelp_vectors.c
@@ -229,13 +229,14 @@ void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size)
         int x   = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1);
         float y = in->y[i] * scale;
 
-        if (in->pitch_lag > 0)
+        if (in->pitch_lag > 0) {
             av_assert0(x < size);
             do {
                 out[x] += y;
                 y *= in->pitch_fac;
                 x += in->pitch_lag;
             } while (x < size && repeats);
+        }
     }
 }
 



More information about the ffmpeg-cvslog mailing list