diff mbox series

[FFmpeg-devel,4/4] avcodec/acelp_vectors: Add missing brackets

Message ID AM7PR03MB66608181D2D0541788F13DE78FF39@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 127da193d4935b44dc70e0fe0c342f7d35908180
Headers show
Series [FFmpeg-devel,1/3] avfilter/vf_vif: Fix mismatch in number of array elements | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 6, 2021, 4:17 p.m. UTC
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.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/acelp_vectors.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 7, 2021, 7:30 p.m. UTC | #1
On Fri, Aug 06, 2021 at 06:17:25PM +0200, Andreas Rheinhardt wrote:
> 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.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/acelp_vectors.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

LGTM

thx

[...]
diff mbox series

Patch

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);
+        }
     }
 }