Unified · Split
| @@ -138,6 +138,7 @@ static float edge_width(BLRContext *blr, int i, int j, int8_t dir, int w, int h, · 137 unmodified lines | |||
| 138 | case DIRECTION_VERTICAL: dX = 0; dY = 1; break; | 138 | case DIRECTION_VERTICAL: dX = 0; dY = 1; break; |
| 139 | case DIRECTION_45UP: dX = 1; dY = -1; break; | 139 | case DIRECTION_45UP: dX = 1; dY = -1; break; |
| 140 | case DIRECTION_45DOWN: dX = 1; dY = 1; break; | 140 | case DIRECTION_45DOWN: dX = 1; dY = 1; break; |
| 141 | default: dX = 1; dY = 1; break; | ||
| 141 | } | 142 | } |
| 142 | 143 | ||
| 143 | // determines if search in direction dX/dY is looking for a maximum or minimum | 144 | // determines if search in direction dX/dY is looking for a maximum or minimum |
| @@ -227,7 +228,7 @@ static float calculate_blur(BLRContext *s, int w, int h, int hsub, int vsub, · 83 unmodified lines | |||
| 227 | } | 228 | } |
| 228 | } | 229 | } |
| 229 | // if not enough edge pixels in a block, consider it smooth | 230 | // if not enough edge pixels in a block, consider it smooth |
| 230 | if (block_total_width >= 2) { | 231 | if (block_total_width >= 2 && block_count) { |
| 231 | blks[blkcnt] = block_total_width / block_count; | 232 | blks[blkcnt] = block_total_width / block_count; |
| 232 | blkcnt++; | 233 | blkcnt++; |
| 233 | } | 234 | } |