[FFmpeg-cvslog] tests/checkasm/vp9dsp: Use snprintf() for safetey

Michael Niedermayer git at videolan.org
Wed Sep 16 14:35:55 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Sep 16 14:08:42 2015 +0200| [a860adb49c4cd9c1271778cb7c2930c25efb2a97] | committer: Michael Niedermayer

tests/checkasm/vp9dsp: Use snprintf() for safetey

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 tests/checkasm/vp9dsp.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
index 35557b6..bd7b4e7 100644
--- a/tests/checkasm/vp9dsp.c
+++ b/tests/checkasm/vp9dsp.c
@@ -143,11 +143,13 @@ static void check_mc(void)
                     for (dx = 0; dx < 2; dx++) {
                         for (dy = 0; dy < 2; dy++) {
                             if (dx || dy) {
-                                sprintf(str, "%s_%s_%d%s", op_names[op],
-                                        filter_names[filter], size,
-                                        subpel_names[dy][dx]);
+                                snprintf(str, sizeof(str),
+                                         "%s_%s_%d%s", op_names[op],
+                                         filter_names[filter], size,
+                                         subpel_names[dy][dx]);
                             } else {
-                                sprintf(str, "%s%d", op_names[op], size);
+                                snprintf(str, sizeof(str),
+                                         "%s%d", op_names[op], size);
                             }
                             if (check_func(dsp.mc[hsize][filter][op][dx][dy],
                                            "vp9_%s_%dbpp", str, bit_depth)) {



More information about the ffmpeg-cvslog mailing list