Re: [FFmpeg-devel] [PATCH v1 2/2] avfilter/vf_showinfo: limit the max number of timecode

2020-03-28 Thread Michael Niedermayer
On Wed, Mar 25, 2020 at 06:45:48PM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavfilter/vf_showinfo.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v1 2/2] avfilter/vf_showinfo: limit the max number of timecode

2020-03-25 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavfilter/vf_showinfo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 71534d1fa8..b0b0051357 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -318,14 +318,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 break;
 case AV_FRAME_DATA_S12M_TIMECODE: {
 uint32_t *tc = (uint32_t*)sd->data;
+int m = FFMIN(tc[0],3);
 if (sd->size != 16) {
 av_log(ctx, AV_LOG_ERROR, "invalid data");
 break;
 }
-for (int j = 1; j <= tc[0]; j++) {
+for (int j = 1; j <= m; j++) {
 char tcbuf[AV_TIMECODE_STR_SIZE];
 av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
-av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] 
? ", " : "");
+av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != m ? ", 
" : "");
 }
 break;
 }
-- 
2.21.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".