diff mbox series

[FFmpeg-devel] avfilter/vf_paletteuse: Add missing parentheses

Message ID AM7PR03MB666051FDF1AB869B7E00D86C8F649@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit f5e74e8d484af23e760e1d4ce292b3a983e0b181
Headers show
Series [FFmpeg-devel] avfilter/vf_paletteuse: Add missing parentheses
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 27, 2021, 2:03 p.m. UTC
Fixes a mistake in dea673d0d548c864ec85f9260d8900d944ef7a2a.
GCC emitted a -Wint-in-bool-context warning because of that.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Will apply this tonight unless there are objections.

 libavfilter/vf_paletteuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Soft Works Nov. 27, 2021, 4:02 p.m. UTC | #1
> -----Original Message-----
> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Sent: Saturday, November 27, 2021 3:03 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>; Soft Works
> <softworkz@hotmail.com>
> Subject: [PATCH] avfilter/vf_paletteuse: Add missing parentheses
> 
> Fixes a mistake in dea673d0d548c864ec85f9260d8900d944ef7a2a.
> GCC emitted a -Wint-in-bool-context warning because of that.
> 
> Reviewed-by: Soft Works <softworkz@hotmail.com>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> Will apply this tonight unless there are objections.
> 
>  libavfilter/vf_paletteuse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
> index 5f20cd75b2..5b300be5a5 100644
> --- a/libavfilter/vf_paletteuse.c
> +++ b/libavfilter/vf_paletteuse.c
> @@ -811,7 +811,7 @@ static void debug_mean_error(PaletteUseContext *s, const
> AVFrame *in1,
>      uint8_t  *src2 =             in2->data[0];
>      const int src1_linesize = in1->linesize[0] >> 2;
>      const int src2_linesize = in2->linesize[0];
> -    const float div = in1->width * in1->height * s->use_alpha ? 4 : 3;
> +    const float div = in1->width * in1->height * (s->use_alpha ? 4 : 3);
>      unsigned mean_err = 0;
> 
>      for (y = 0; y < in1->height; y++) {
> --
> 2.32.0

LGTM

Thanks for spotting.
diff mbox series

Patch

diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index 5f20cd75b2..5b300be5a5 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -811,7 +811,7 @@  static void debug_mean_error(PaletteUseContext *s, const AVFrame *in1,
     uint8_t  *src2 =             in2->data[0];
     const int src1_linesize = in1->linesize[0] >> 2;
     const int src2_linesize = in2->linesize[0];
-    const float div = in1->width * in1->height * s->use_alpha ? 4 : 3;
+    const float div = in1->width * in1->height * (s->use_alpha ? 4 : 3);
     unsigned mean_err = 0;
 
     for (y = 0; y < in1->height; y++) {