mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 14:01:27 +00:00
error_concealment: Prevent FPEs in case of corrupted input.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e2d110d8d2
commit
71c2a70cbf
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user