Bugfix FS#13696 - ID3 year with substring cause panic

The issue was the false case returning NULL for children elements
instead just ignore the false branch for everything but
SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE

Change-Id: Ie0f4f51646faf116e563ab7e60d52d18759f4220
This commit is contained in:
William Wilgus 2025-11-25 16:53:12 -05:00
parent 936482abb5
commit 4e4af2fe96

View file

@ -624,7 +624,7 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i
static int get_subline_timeout(struct gui_wps *gwps, struct skin_element* line) static int get_subline_timeout(struct gui_wps *gwps, struct skin_element* line)
{ {
struct skin_element *element=line; struct skin_element *element=line;
struct wps_token *token; struct wps_token *token = NULL;
int retval = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT; int retval = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT;
if (element->type == LINE) if (element->type == LINE)
{ {
@ -662,9 +662,12 @@ static int get_subline_timeout(struct gui_wps *gwps, struct skin_element* line)
struct conditional *conditional = SKINOFFSETTOPTR(skin_buffer, element->data); struct conditional *conditional = SKINOFFSETTOPTR(skin_buffer, element->data);
int val = evaluate_conditional(gwps, 0, conditional, element->children_count); int val = evaluate_conditional(gwps, 0, conditional, element->children_count);
int tmoval = get_subline_timeout(gwps, get_child(element->children, val)); if (val >= 0 || (token && token->type == SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE))
if (tmoval >= 0) {/* only need tmoval in false case if SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE */
return MAX(retval, tmoval); /* Bugfix %t()%?CONDITIONAL tmo ignored */ int tmoval = get_subline_timeout(gwps, get_child(element->children, val));
if (tmoval >= 0)
return MAX(retval, tmoval); /* Bugfix %t()%?CONDITIONAL tmo ignored */
}
} }
else if (type == COMMENT) else if (type == COMMENT)
{ {