]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils_opencl.c
avutil/softfloat: Fix overflows in shifts in av_cmp_sf() and av_gt_sf()
[ffmpeg] / cmdutils_opencl.c
index d9095b61be27f7620cbf304c554e33a3e306ebde..dd21344a056f283a03e2a52858bcf111fdaaf107 100644 (file)
@@ -206,7 +206,9 @@ end:
 
 static int compare_ocl_device_desc(const void *a, const void *b)
 {
-    return ((const OpenCLDeviceBenchmark*)a)->runtime - ((const OpenCLDeviceBenchmark*)b)->runtime;
+    const OpenCLDeviceBenchmark* va = (const OpenCLDeviceBenchmark*)a;
+    const OpenCLDeviceBenchmark* vb = (const OpenCLDeviceBenchmark*)b;
+    return FFDIFFSIGN(va->runtime , vb->runtime);
 }
 
 int opt_opencl_bench(void *optctx, const char *opt, const char *arg)