[FFmpeg-cvslog] Fix format string vulnerability detected by -Wformat-security.

Fabian Greffrath git at videolan.org
Mon Apr 2 01:45:23 CEST 2012


ffmpeg | branch: release/0.8 | Fabian Greffrath <fabian at greffrath.com> | Mon Mar  5 16:06:01 2012 +0100| [f375e19f37c7d1738cde70e43c3f64c6ab68c928] | committer: Reinhard Tartler

Fix format string vulnerability detected by -Wformat-security.

Signed-off-by: Diego Biurrun <diego at biurrun.de>
(cherry picked from commit c9dbac36ad4bac07f6c1d06d465e361ab55bcb95)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

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

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

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index 677c550..99cbd94 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