]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/mathematics.c
Merge commit '711781d7a1714ea4eb0217eb1ba04811978c43d1'
[ffmpeg] / libavutil / mathematics.c
index c12c73e6e6552675968ef930098b27d60e8b03f0..20ff37f5e9d7667758812332e1c7ec02c66835fc 100644 (file)
@@ -85,7 +85,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
         else {
             int64_t ad = a / c;
             int64_t a2 = (a % c * b + r) / c;
-            if (ad >= INT32_MAX && ad > (INT64_MAX - a2) / b)
+            if (ad >= INT32_MAX && b && ad > (INT64_MAX - a2) / b)
                 return INT64_MIN;
             return ad * b + a2;
         }