Commit 8d5ce819 authored by James Berry's avatar James Berry
Browse files

bug fix possible keyframe context divide by zero

vp8_adjust_key_frame_context() divides by
estimate_keyframe_frequency() which can
return 0 in the case where --kf-max-dist=0.

Change-Id: Idfc59653478a0073187cd2aa420e98a321103daa
parent 496bcbb0
......@@ -1468,8 +1468,10 @@ static int estimate_keyframe_frequency(VP8_COMP *cpi)
/* Assume a default of 1 kf every 2 seconds, or the max kf interval,
* whichever is smaller.
*/
int key_freq = cpi->oxcf.key_freq>0 ? cpi->oxcf.key_freq : 1;
av_key_frame_frequency = (int)cpi->output_frame_rate * 2;
if (av_key_frame_frequency > cpi->oxcf.key_freq)
if (cpi->oxcf.auto_key && av_key_frame_frequency > key_freq)
av_key_frame_frequency = cpi->oxcf.key_freq;
cpi->prior_key_frame_distance[KEY_FRAME_CONTEXT - 1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment