1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/blockdetect: Fix possible div by 0

Found-by Covererity, CID 1504568, 1504569
This commit is contained in:
Thilo Borgmann 2022-06-04 13:45:30 +02:00
parent 11912f65ef
commit b7cea55730

View File

@ -132,8 +132,10 @@ static float calculate_blockiness(BLKContext *s, int w, int h,
nonblock_count++;
}
}
if (block_count && nonblock_count) {
temp = (block / block_count) / (nonblock / nonblock_count);
ret = FFMAX(ret, temp);
}
}
// vertical blockiness (fixed height)
@ -175,8 +177,10 @@ static float calculate_blockiness(BLKContext *s, int w, int h,
nonblock_count++;
}
}
if (block_count && nonblock_count) {
temp = (block / block_count) / (nonblock / nonblock_count);
ret = FFMAX(ret, temp);
}
}
// return highest value of horz||vert