vf_idet: reorder operations to avoid division by 0

Fixes CID733738
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-19 19:35:31 +02:00
parent 0fa26bd470
commit 31fdf3065d

View File

@ -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;
}else if(alpha[1] / (float)alpha[0] > idet->interlace_threshold){
}else if(alpha[1] > idet->interlace_threshold * alpha[0]){
type = BFF;
}else if(alpha[1] / (float)delta > idet->progressive_threshold){
}else if(alpha[1] > idet->progressive_threshold * delta){
type = PROGRSSIVE;
}else{
type = UNDETERMINED;