[FFmpeg-cvslog] srtdec: fix a format string vulnerability.

Fabian Greffrath git at videolan.org
Sat Mar 3 02:56:56 CET 2012


ffmpeg | branch: master | Fabian Greffrath <fabian at greffrath.com> | Sat Mar  3 02:35:27 2012 +0100| [aaa1173de775b9b865a714abcc270816d2f59dff] | committer: Michael Niedermayer

srtdec: fix a format string vulnerability.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/srtdec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index aa73f4c..b6f2dad 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -110,7 +110,7 @@ static const char *srt_to_ass(AVCodecContext *avctx, char *out, char *out_end,
                                     for (j=sptr-2; j>=0; j--)
                                         if (stack[j].param[i][0]) {
                                             out += snprintf(out, out_end-out,
-                                                            stack[j].param[i]);
+                                                            "%s", stack[j].param[i]);
                                             break;
                                         }
                         } else {
@@ -146,7 +146,7 @@ static const char *srt_to_ass(AVCodecContext *avctx, char *out, char *out_end,
                             for (i=0; i<PARAM_NUMBER; i++)
                                 if (stack[sptr].param[i][0])
                                     out += snprintf(out, out_end-out,
-                                                    stack[sptr].param[i]);
+                                                    "%s", stack[sptr].param[i]);
                         }
                     } else if (!buffer[1] && strspn(buffer, "bisu") == 1) {
                         out += snprintf(out, out_end-out,



More information about the ffmpeg-cvslog mailing list