Fixes a SIGFPE crash when the mcdeint filter is run in slow mode.
When processing macroblocks that are completely out of bounds,
the loops calculating the squared overlapping weights (aa) are
skipped, leaving 'aa' as 0. This patch returns 0 early if 'aa'
is 0 to prevent the subsequent division by zero in ROUNDED_DIV.
Fixes ticket #7779.
---
libavcodec/snowenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 5312d48e99..77ef802fbe 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -722,6 +722,8 @@ static int get_dc(SnowEncContext *enc, int mb_x, int mb_y,
int plane_index)
}
}
*b= backup;
+ if (aa ==0)
+ return 0;
return av_clip_uint8( ROUNDED_DIV((int64_t)ab<<LOG2_OBMC_MAX, aa) );
//FIXME we should not need clipping
}
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]