1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00

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>
This commit is contained in:
Michael Niedermayer 2017-04-07 23:05:57 +02:00
parent 0b4d87fad1
commit 7182fbc471

View File

@ -64,7 +64,7 @@ static int decode_write_frame(const char *outfilename, AVCodecContext *avctx,
fflush(stdout); fflush(stdout);
/* the picture is allocated by the decoder, no need to free it */ /* 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], pgm_save(frame->data[0], frame->linesize[0],
frame->width, frame->height, buf); frame->width, frame->height, buf);
(*frame_count)++; (*frame_count)++;