[FFmpeg-devel] [PATCH v1 2/2] avfilter/vsrc_life: fix the print argument mismatch

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sat Dec 7 04:53:11 EET 2019


From: Limin Wang <lance.lmwang at gmail.com>

Fix CID 1456556

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavfilter/vsrc_life.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
index 4c0ea73..01b060a 100644
--- a/libavfilter/vsrc_life.c
+++ b/libavfilter/vsrc_life.c
@@ -236,6 +236,7 @@ static av_cold int init(AVFilterContext *ctx)
     if (!life->filename) {
         /* fill the grid randomly */
         int i;
+        uint32_t seed;
 
         if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
             !(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
@@ -245,8 +246,10 @@ static av_cold int init(AVFilterContext *ctx)
         }
         if (life->random_seed == -1)
             life->random_seed = av_get_random_seed();
+        seed = life->random_seed;
+        av_log(ctx, AV_LOG_VERBOSE, "random seed: 0x%08"PRIx32"\n", seed);
 
-        av_lfg_init(&life->lfg, life->random_seed);
+        av_lfg_init(&life->lfg, seed);
 
         for (i = 0; i < life->w * life->h; i++) {
             double r = (double)av_lfg_get(&life->lfg) / UINT32_MAX;
@@ -260,10 +263,9 @@ static av_cold int init(AVFilterContext *ctx)
     }
 
     av_log(ctx, AV_LOG_VERBOSE,
-           "s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%"PRIu32"\n",
+           "s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d\n",
            life->w, life->h, life->frame_rate.num, life->frame_rate.den,
-           life->rule_str, life->stay_rule, life->born_rule, life->stitch,
-           life->random_seed);
+           life->rule_str, life->stay_rule, life->born_rule, life->stitch);
     return 0;
 }
 
-- 
2.9.5



More information about the ffmpeg-devel mailing list