Skip to content

Commit

Permalink
check whether value of TSI is numeric in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
touatily committed Feb 20, 2024
1 parent f7fdd2d commit 6163d3e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/media_tools/route_dmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,14 @@ static GF_Err gf_route_service_setup_stsid(GF_ROUTEDmx *routedmx, GF_ROUTEServic
//extract TSI
k=0;
while ((att = gf_list_enum(ls->attributes, &k))) {
if (!strcmp(att->name, "tsi")) sscanf(att->value, "%u", &tsi);
if (!strcmp(att->name, "tsi")) {
char* end_ptr;
tsi = strtol(att->value, &end_ptr, 10);
if(end_ptr == att->value || *end_ptr != '\0') {
GF_LOG(GF_LOG_ERROR, GF_LOG_ROUTE, ("[ROUTE] Service %d wrong TSI value (%s), it should be numeric \n", s->service_id, att->value));
return GF_CORRUPTED_DATA;
}
}
}
if (!tsi) {
GF_LOG(GF_LOG_ERROR, GF_LOG_ROUTE, ("[ROUTE] Service %d missing TSI in LS/ROUTE session\n", s->service_id));
Expand Down

0 comments on commit 6163d3e

Please sign in to comment.