Commit 31fdf306 authored by Michael Niedermayer's avatar Michael Niedermayer

vf_idet: reorder operations to avoid division by 0

Fixes CID733738
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0fa26bd4
...@@ -118,11 +118,11 @@ static void filter(AVFilterContext *ctx) ...@@ -118,11 +118,11 @@ static void filter(AVFilterContext *ctx)
} }
} }
if (alpha[0] / (float)alpha[1] > idet->interlace_threshold){ if (alpha[0] > idet->interlace_threshold * alpha[1]){
type = TFF; type = TFF;
}else if(alpha[1] / (float)alpha[0] > idet->interlace_threshold){ }else if(alpha[1] > idet->interlace_threshold * alpha[0]){
type = BFF; type = BFF;
}else if(alpha[1] / (float)delta > idet->progressive_threshold){ }else if(alpha[1] > idet->progressive_threshold * delta){
type = PROGRSSIVE; type = PROGRSSIVE;
}else{ }else{
type = UNDETERMINED; type = UNDETERMINED;
......
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