vf_idet: reorder operations to avoid division by 0

Fixes CID733738
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/6/merge
Michael Niedermayer 12 years ago
parent 0fa26bd470
commit 31fdf3065d
  1. 6
      libavfilter/vf_idet.c

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

Loading…
Cancel
Save