Skip to content
Snippets Groups Projects
Commit eac29ae2 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix some broken clamping in rate control.

If we have some dupe frames right near the end of the buffer, our
 metric window can be slightly larger than the buffer.
However, the clamping we use to determine how many frames' worth of
 metrics to add to the buffer had a mix of signed and unsigned
 types, so if that number when negative, instead of clamping
 against zero, it would ask for all remaining frames in the file.
That would cause an infinite loop when we tried to find the last
 keyframe in the circular buffer in oc_enc_select_qi() (which was
 not big enough to actually hold that many frames).

This patch changes the clamp to a form that works with all unsigned
 values.

Thanks to Brion Vibber for the report.

Fixes #2229

Forward-port of r19507 from svn.
parent 50fd339b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment