The field width in a %s directive gives the amount of characters to read from the input and not the size of the receiving buffer; the latter must be of course also have space for the trailing \0 which has been forgotten here. The commit adds it (and fixes a -Wfortify-source warning from Clang).
Unified · Split
| @@ -297,7 +297,7 @@ static int run_file_tests(const AVFrame *ref, FILE *fp, struct options opts) · 296 unmodified lines | ||
| 297 | 297 | int ret; |
| 298 | 298 | |
| 299 | 299 | while (fgets(buf, sizeof(buf), fp)) { |
| 300 | − char src_fmt_str[20], dst_fmt_str[20]; | |
| 300 | + char src_fmt_str[21], dst_fmt_str[21]; | |
| 301 | 301 | enum AVPixelFormat src_fmt; |
| 302 | 302 | enum AVPixelFormat dst_fmt; |
| 303 | 303 | int sw, sh, dw, dh, mse[4]; |