[FFmpeg-cvslog] error_concealment: Prevent FPEs in case of corrupted input.
Michael Niedermayer
git at videolan.org
Fri Mar 23 22:18:55 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar 23 21:56:42 2012 +0100| [71c2a70cbfbb5fea6dffa5e462b0227565e29bcc] | committer: Michael Niedermayer
error_concealment: Prevent FPEs in case of corrupted input.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=71c2a70cbfbb5fea6dffa5e462b0227565e29bcc
---
libavcodec/error_resilience.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index cd6aa01..c93cea5 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -248,7 +248,7 @@ static void guess_dc(MpegEncContext *s, int16_t *dc, int w,
weight_sum = 0;
guess = 0;
for (j = 0; j < 4; j++) {
- int64_t weight = 256 * 256 * 256 * 16 / dist[b_x + b_y*stride][j];
+ int64_t weight = 256 * 256 * 256 * 16 / FFMAX(dist[b_x + b_y*stride][j], 1);
guess += weight*(int64_t)col[b_x + b_y*stride][j];
weight_sum += weight;
}
More information about the ffmpeg-cvslog
mailing list