aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-04-07 23:05:57 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-04-11 23:39:21 +0200
commit7182fbc47182c613331b254cc57f5ae9a41c8269 (patch)
treebd75956fc139a55a8096805c6bb07650d294d771
parent0b4d87fad122831206cf600a801d118d1b517a54 (diff)
downloadffmpeg-7182fbc47182c613331b254cc57f5ae9a41c8269.tar.gz
doc/examples/decode_video: Fix format string vulnerability
Fixes: CID1404843 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 23edd41a0d6994cb5d9983d8f035e8eef78960ad) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--doc/examples/decode_video.c2
1 files changed, 1 insertions, 1 deletions
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)++;