[FFmpeg-cvslog] lavfi/vf_thumbnail_cuda: fix operator precedence bug

Rodger Combs git at videolan.org
Tue Jul 30 16:18:45 EEST 2019


ffmpeg | branch: release/4.2 | Rodger Combs <rodger.combs at gmail.com> | Tue Jul 30 02:51:43 2019 -0500| [6a5ed71d36f700219f6f8cc69d767343f2fb8cb7] | committer: Timo Rothenpieler

lavfi/vf_thumbnail_cuda: fix operator precedence bug

Discovered via a warning when building with clang

Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a5ed71d36f700219f6f8cc69d767343f2fb8cb7
---

 libavfilter/vf_thumbnail_cuda.cu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_thumbnail_cuda.cu b/libavfilter/vf_thumbnail_cuda.cu
index c73e49fbc6..d4d4d791f6 100644
--- a/libavfilter/vf_thumbnail_cuda.cu
+++ b/libavfilter/vf_thumbnail_cuda.cu
@@ -71,7 +71,7 @@ __global__ void Thumbnail_ushort2(cudaTextureObject_t ushort2_tex,
     {
         ushort2 pixel = tex2D<ushort2>(ushort2_tex, x, y);
         atomicAdd(&histogram[(pixel.x + 128) >> 8], 1);
-        atomicAdd(&histogram[256 + (pixel.y + 128) >> 8], 1);
+        atomicAdd(&histogram[256 + ((pixel.y + 128) >> 8)], 1);
     }
 }
 



More information about the ffmpeg-cvslog mailing list