+ for (i = 0; i < FF_ARRAY_ELEMS(numlist); i++) {
+ int64_t a = numlist[i];
+
+ for (j = 0; j < FF_ARRAY_ELEMS(numlist); j++) {
+ int64_t b = numlist[j];
+ if (b<=0)
+ continue;
+ for (k = 0; k < FF_ARRAY_ELEMS(numlist); k++) {
+ int64_t c = numlist[k];
+ int64_t res;
+ AVInteger ai;
+
+ if (c<=0)
+ continue;
+ res = av_rescale_rnd(a,b,c, AV_ROUND_ZERO);
+
+ ai = av_mul_i(av_int2i(a), av_int2i(b));
+ ai = av_div_i(ai, av_int2i(c));
+
+ if (av_cmp_i(ai, av_int2i(INT64_MAX)) > 0 && res == INT64_MIN)
+ continue;
+ if (av_cmp_i(ai, av_int2i(INT64_MIN)) < 0 && res == INT64_MIN)
+ continue;
+ if (av_cmp_i(ai, av_int2i(res)) == 0)
+ continue;
+
+ // Special exception for INT64_MIN, remove this in case INT64_MIN is handled without off by 1 error
+ if (av_cmp_i(ai, av_int2i(res-1)) == 0 && a == INT64_MIN)
+ continue;
+
+ av_log(NULL, AV_LOG_ERROR, "%"PRId64" * %"PRId64" / %"PRId64" = %"PRId64" or %"PRId64"\n", a,b,c, res, av_i2int(ai));
+ }
+ }
+ }
+