mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-03 13:32:10 +00:00
lavfi/blockdetect: Fix possible div by 0
Found-by Covererity, CID 1504568, 1504569
This commit is contained in:
parent
11912f65ef
commit
b7cea55730
@ -132,9 +132,11 @@ 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)
|
||||
block_count = 0;
|
||||
@ -175,9 +177,11 @@ 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
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user