It can't really happen, because no currently used pixel format has a name exceeding the size of the buffer.
Unified · Split
| @@ -2666,10 +2666,10 @@ static void print_pixel_format(WriterContext *w, enum AVPixelFormat pix_fmt) · 2665 unmodified lines | |||
| 2666 | char buf[128]; | 2666 | char buf[128]; |
| 2667 | size_t i = 0; | 2667 | size_t i = 0; |
| 2668 | 2668 | ||
| 2669 | while (s[i] && s[i] == s2[i]) | 2669 | while (s[i] && s[i] == s2[i] && i < sizeof(buf) - 1) { |
| 2670 | buf[i] = s[i]; | ||
| 2670 | i++; | 2671 | i++; |
| 2671 | 2672 | } | |
| 2672 | memcpy(buf, s, FFMIN(sizeof(buf) - 1, i)); | ||
| 2673 | buf[i] = '\0'; | 2673 | buf[i] = '\0'; |
| 2674 | 2674 | ||
| 2675 | print_str ("pix_fmt", buf); | 2675 | print_str ("pix_fmt", buf); |