A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

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

+7 -4
+7 -4
apps/gui/skin_engine/skin_render.c
··· 624 624 static int get_subline_timeout(struct gui_wps *gwps, struct skin_element* line) 625 625 { 626 626 struct skin_element *element=line; 627 - struct wps_token *token; 627 + struct wps_token *token = NULL; 628 628 int retval = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT; 629 629 if (element->type == LINE) 630 630 { ··· 662 662 struct conditional *conditional = SKINOFFSETTOPTR(skin_buffer, element->data); 663 663 int val = evaluate_conditional(gwps, 0, conditional, element->children_count); 664 664 665 - int tmoval = get_subline_timeout(gwps, get_child(element->children, val)); 666 - if (tmoval >= 0) 667 - return MAX(retval, tmoval); /* Bugfix %t()%?CONDITIONAL tmo ignored */ 665 + if (val >= 0 || (token && token->type == SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE)) 666 + {/* only need tmoval in false case if SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE */ 667 + int tmoval = get_subline_timeout(gwps, get_child(element->children, val)); 668 + if (tmoval >= 0) 669 + return MAX(retval, tmoval); /* Bugfix %t()%?CONDITIONAL tmo ignored */ 670 + } 668 671 } 669 672 else if (type == COMMENT) 670 673 {