From 7182fbc47182c613331b254cc57f5ae9a41c8269 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 7 Apr 2017 23:05:57 +0200 Subject: [PATCH] doc/examples/decode_video: Fix format string vulnerability Fixes: CID1404843 Signed-off-by: Michael Niedermayer (cherry picked from commit 23edd41a0d6994cb5d9983d8f035e8eef78960ad) Signed-off-by: Michael Niedermayer --- 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)++;