You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
fftools/ffprobe: Fix hypothetical stack buffer overflow
It can't really happen, because no currently used pixel format has a name exceeding the size of the buffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -2666,10 +2666,10 @@ static void print_pixel_format(WriterContext *w, enum AVPixelFormat pix_fmt)
|
||||
char buf[128];
|
||||
size_t i = 0;
|
||||
|
||||
while (s[i] && s[i] == s2[i])
|
||||
while (s[i] && s[i] == s2[i] && i < sizeof(buf) - 1) {
|
||||
buf[i] = s[i];
|
||||
i++;
|
||||
|
||||
memcpy(buf, s, FFMIN(sizeof(buf) - 1, i));
|
||||
}
|
||||
buf[i] = '\0';
|
||||
|
||||
print_str ("pix_fmt", buf);
|
||||
|
Reference in New Issue
Block a user