[FFmpeg-cvslog] vf_idet: reorder operations to avoid division by 0
Michael Niedermayer
git at videolan.org
Fri Oct 19 20:00:22 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 19 19:35:31 2012 +0200| [31fdf3065daceb31e12fd26a367445676d761180] | committer: Michael Niedermayer
vf_idet: reorder operations to avoid division by 0
Fixes CID733738
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31fdf3065daceb31e12fd26a367445676d761180
---
libavfilter/vf_idet.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 1e067ef..d64c48c 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;
More information about the ffmpeg-cvslog
mailing list