]> git.sesse.net Git - ffmpeg/commitdiff
lavc/xface: Reorder conditions to silence a gcc warning.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 26 Feb 2017 10:03:50 +0000 (11:03 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 24 Mar 2017 18:51:36 +0000 (19:51 +0100)
libavcodec/xface.c:318:27: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]

libavcodec/xface.c

index 8c0cbfdb84af3c42b9f5bda6660070cb6e874909..184c17417754ba84e2563c477b13edc6a2d304be 100644 (file)
@@ -315,9 +315,9 @@ 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 <= 0 || l >= i && m == j)
                         continue;
-                    if (l > 0 && l <= XFACE_WIDTH && m > 0)
+                    if (l <= XFACE_WIDTH && m > 0)
                         k = 2*k + src[l + m * XFACE_WIDTH];
                 }
             }