diff mbox series

[FFmpeg-devel] avcodec/bsf/noise: fix av_log format specifier

Message ID 20240426173057.259957-1-marcus@marcusspencer.xyz
State New
Headers show
Series [FFmpeg-devel] avcodec/bsf/noise: fix av_log format specifier | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Marcus B Spencer April 26, 2024, 5:30 p.m. UTC
Replace the "%d" specifier corresponding to the 2nd argument of av_log starting on line 176 with "%u", due to the fact that the 2nd argument is an unsigned int. Without this patch, if the second argument exceeded the maximum value of an int, the behavior would be undefined.

Signed-off-by: Marcus B Spencer <marcus@marcusspencer.xyz>
---
 libavcodec/bsf/noise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/bsf/noise.c b/libavcodec/bsf/noise.c
index a622855717..d36be5fab4 100644
--- a/libavcodec/bsf/noise.c
+++ b/libavcodec/bsf/noise.c
@@ -173,7 +173,7 @@  static int noise(AVBSFContext *ctx, AVPacket *pkt)
         drop = !(s->state % s->dropamount);
     }
 
-    av_log(ctx, AV_LOG_VERBOSE, "Stream #%d packet %d pts %"PRId64" - amount %d drop %d\n",
+    av_log(ctx, AV_LOG_VERBOSE, "Stream #%d packet %u pts %"PRId64" - amount %d drop %d\n",
            pkt->stream_index, (unsigned int)s->var_values[VAR_N], pkt->pts, amount, drop);
 
     if (drop) {