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:
parent
11912f65ef
commit
b7cea55730
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user