summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-03-25 18:45:48 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2020-03-28 19:21:11 +0100
commit585ac1ff5b3009353d3dc0e88068e0d91b4470a4 (patch)
tree1b909bd0b95463d5a275c06500df36512744f354 /libavfilter
parent4976b102d89787d59a3aaa438b76c62aec86ad5a (diff)
avfilter/vf_showinfo: limit the max number of timecode
Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_showinfo.c5
1 files 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;
}