[FFmpeg-devel] [PATCH] avcodec/xface: suppress -Wstrict-overflow warnings

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sat Sep 26 17:05:39 CEST 2015


On Fri, Sep 18, 2015 at 5:31 PM, Ganesh Ajjanagadde
<gajjanagadde at gmail.com> wrote:
> This patch results in identical behavior of xface, and suppresses -Wstrict-overflow
> warnings observed in GCC 5.2.
> I have manually checked that this usage is safe, and overflow possibility does
> not exist with this expression rewrite.
>
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavcodec/xface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/xface.c b/libavcodec/xface.c
> index 8c0cbfd..78b6def 100644
> --- a/libavcodec/xface.c
> +++ b/libavcodec/xface.c
> @@ -315,7 +315,7 @@ void ff_xface_generate_face(uint8_t *dst, uint8_t * const src)
>
>              for (l = i - 2; l <= i + 2; l++) {
>                  for (m = j - 2; m <= j; m++) {
> -                    if (l >= i && m == j)
> +                    if ((l - i >= 0) && m == j)
>                          continue;
>                      if (l > 0 && l <= XFACE_WIDTH && m > 0)
>                          k = 2*k + src[l + m * XFACE_WIDTH];
> --
> 2.5.2
>

ping


More information about the ffmpeg-devel mailing list