shithub: dav1d

Download patch

ref: 35d3d2b61b32794e8527b84d29fdd8cc48d75159
parent: 4d9c990e3703ce49da5f5e6bbc8dea0638f46cfa
author: Ronald S. Bultje <rsbultje@gmail.com>
date: Thu Nov 21 08:52:21 EST 2019

Fix stride type

Prevents the following compiler warning:

../src/decode.c:1979:32: warning: implicit conversion loses integer precision: 'const ptrdiff_t' (aka 'const long') to 'int' [-Wshorten-64-to-32]
            const int stride = f->cur.stride[!!p];
                      ~~~~~~   ^~~~~~~~~~~~~~~~~~
1 warning generated.

--- a/src/decode.c
+++ b/src/decode.c
@@ -1976,7 +1976,7 @@
         for (int p = 0; p < 1 + 2 * has_chroma; p++) {
             const int ss_ver = p && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
             const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
-            const int stride = f->cur.stride[!!p];
+            const ptrdiff_t stride = f->cur.stride[!!p];
             const int bx = t->bx & ~ss_hor;
             const int by = t->by & ~ss_ver;
             const int width  = w4 << (2 - ss_hor + (bw4 == ss_hor));