diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-19 21:35:31 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-19 21:59:32 +0400 |
commit | 31fdf3065daceb31e12fd26a367445676d761180 (patch) | |
tree | b591692cd8c7493310beffda6bd79454491f2acf /libavfilter | |
parent | 0fa26bd4703cf8ee84ae9b9859be2b4e0e77d42f (diff) |
vf_idet: reorder operations to avoid division by 0
Fixes CID733738
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_idet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index 1e067ef565..d64c48c85c 100644 --- a/libavfilter/vf_idet.c +++ b/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; |