Merge commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428'
* commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428': dashenc: Avoid a VLA-like construct Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
f001a2bd34
@ -308,8 +308,7 @@ static void dash_fill_tmpl_params(char *dst, size_t buffer_size,
|
|||||||
int dst_pos = 0;
|
int dst_pos = 0;
|
||||||
const char *t_cur = template;
|
const char *t_cur = template;
|
||||||
while (dst_pos < buffer_size - 1 && *t_cur) {
|
while (dst_pos < buffer_size - 1 && *t_cur) {
|
||||||
int format_tag_size = 7;
|
char format_tag[7]; // May be "%d", "%0Xd", or "%0Xlld" (for $Time$), where X is in [0-9]
|
||||||
char format_tag[format_tag_size]; // May be "%d", "%0Xd", or "%0Xlld" (for $Time$), where X is in [0-9]
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
DASHTmplId id_type;
|
DASHTmplId id_type;
|
||||||
const char *t_next = strchr(t_cur, '$'); // copy over everything up to the first '$' character
|
const char *t_next = strchr(t_cur, '$'); // copy over everything up to the first '$' character
|
||||||
@ -328,7 +327,7 @@ static void dash_fill_tmpl_params(char *dst, size_t buffer_size,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// t_cur is now pointing to a '$' character
|
// t_cur is now pointing to a '$' character
|
||||||
id_type = dash_read_tmpl_id(t_cur, format_tag, format_tag_size, &t_next);
|
id_type = dash_read_tmpl_id(t_cur, format_tag, sizeof(format_tag), &t_next);
|
||||||
switch (id_type) {
|
switch (id_type) {
|
||||||
case DASH_TMPL_ID_ESCAPE:
|
case DASH_TMPL_ID_ESCAPE:
|
||||||
av_strlcpy(&dst[dst_pos], "$", 2);
|
av_strlcpy(&dst[dst_pos], "$", 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user