[FFmpeg-cvslog] doc/examples/decode_video: Fix format string vulnerability

Michael Niedermayer git at videolan.org
Wed Apr 12 01:01:05 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Fri Apr  7 23:05:57 2017 +0200| [7182fbc47182c613331b254cc57f5ae9a41c8269] | committer: Michael Niedermayer

doc/examples/decode_video: Fix format string vulnerability

Fixes: CID1404843

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 23edd41a0d6994cb5d9983d8f035e8eef78960ad)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7182fbc47182c613331b254cc57f5ae9a41c8269
---

 doc/examples/decode_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/examples/decode_video.c b/doc/examples/decode_video.c
index dd1177b8b0..3413ad9312 100644
--- a/doc/examples/decode_video.c
+++ b/doc/examples/decode_video.c
@@ -64,7 +64,7 @@ static int decode_write_frame(const char *outfilename, AVCodecContext *avctx,
         fflush(stdout);
 
         /* the picture is allocated by the decoder, no need to free it */
-        snprintf(buf, sizeof(buf), outfilename, *frame_count);
+        snprintf(buf, sizeof(buf), "%s-%d", outfilename, *frame_count);
         pgm_save(frame->data[0], frame->linesize[0],
                  frame->width, frame->height, buf);
         (*frame_count)++;



More information about the ffmpeg-cvslog mailing list