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
1 changed files with 3 additions and 3 deletions

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; 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;