Fixes: floating point division by 0 Fixes: -nan is outside the range of representable values of type 'int' Fixes: Ticket8307
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -167,6 +167,11 @@ static void print_stats(AVFilterContext *ctx) · 166 unmodified lines | |||
| 167 | float chdr, secondpeak, rmssum = 0; | 167 | float chdr, secondpeak, rmssum = 0; |
| 168 | int i, j, first = 0; | 168 | int i, j, first = 0; |
| 169 | 169 | ||
| 170 | if (!p->nb_samples) { | ||
| 171 | av_log(ctx, AV_LOG_INFO, "No data, dynamic range not meassurable\n"); | ||
| 172 | return; | ||
| 173 | } | ||
| 174 | |||
| 170 | finish_block(p); | 175 | finish_block(p); |
| 171 | 176 | ||
| 172 | for (i = 0; i <= 10000; i++) { | 177 | for (i = 0; i <= 10000; i++) { |