[FFmpeg-devel] [PATCH][RFC] Lagarith Decoder.

Reimar Döffinger Reimar.Doeffinger
Fri Aug 14 22:45:05 CEST 2009

On Mon, Aug 10, 2009 at 11:42:19PM -0600, Nathan Caldwell wrote:
> +    scaled_cumul_prob = cumulative_target - scaled_cumul_prob;
> +
> +    if (scaled_cumul_prob > INT_MAX) {

While FFmpeg requires it in a few places, I think this is ugly code
because it assumes two's complement without good reason.
If speed is critical I guess this should be a debug-only assert,
otherwise just
if (scaled_cumul_prob > cumulative_target)
with those code lines swapped of course.

More information about the ffmpeg-devel mailing list