Skip to content

Commit

Permalink
dash client: check SupplementalProperty value has been correctly pars…
Browse files Browse the repository at this point in the history
…ed (closes #2626)
  • Loading branch information
aureliendavid committed Oct 9, 2023
1 parent 3e291b6 commit b56ed1f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/media_tools/dash_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static GF_Err gf_dash_get_date(GF_DashClient *dash, char *scheme_id, char *url,
}
}
gf_blob_release(cache_name);

dash->dash_io->del(dash->dash_io, dash->pending_utc_session);
dash->pending_utc_session = NULL;
return res;
Expand Down Expand Up @@ -2236,7 +2236,7 @@ static GF_Err gf_dash_solve_m3u8_representation_xlink(GF_DASH_Group *group, GF_M
gf_free(xlink_copy);
return e;
}

if (gf_url_is_local(xlink_copy)) {
local_url = xlink_copy;
} else {
Expand Down Expand Up @@ -3903,7 +3903,7 @@ static void dash_store_stats(GF_DashClient *dash, GF_DASH_Group *group, u32 byte
}
#endif


if (!bytes_per_sec && group->local_files) {
bytes_per_sec = (u32) -1;
bytes_per_sec /= 8;
Expand Down Expand Up @@ -4972,7 +4972,7 @@ static GF_Err gf_dash_download_init_segment(GF_DashClient *dash, GF_DASH_Group *
}
}
if (key_url) gf_free(key_url);

group->nb_cached_segments = 1;
group->download_segment_index += nb_segment_read;

Expand Down Expand Up @@ -6381,7 +6381,7 @@ static GF_Err gf_dash_setup_period(GF_DashClient *dash)

for (j=0; j<gf_list_count(group->adaptation_set->supplemental_properties); j++) {
GF_MPD_Descriptor *mpd_desc = gf_list_get(group->adaptation_set->supplemental_properties, j);
if (!strcmp(mpd_desc->scheme_id_uri, "urn:mpeg:dash:srd:2014")) {
if (mpd_desc && mpd_desc->scheme_id_uri && !strcmp(mpd_desc->scheme_id_uri, "urn:mpeg:dash:srd:2014") && mpd_desc->value) {
u32 id, w, h, res;
w = h = 0;
res = sscanf(mpd_desc->value, "%d,%d,%d,%d,%d,%d,%d", &id, &group->srd_x, &group->srd_y, &group->srd_w, &group->srd_h, &w, &h);
Expand Down Expand Up @@ -6550,7 +6550,7 @@ static GF_Err gf_dash_setup_period(GF_DashClient *dash)
dash->dash_state = GF_DASH_STATE_SETUP;
return GF_OK;
}

// active representation is marked as disabled, we need to redo the selection
if (rep_sel->playback.disabled)
goto select_active_rep;
Expand Down Expand Up @@ -8034,7 +8034,7 @@ static GF_Err gf_dash_process_internal(GF_DashClient *dash)
dash->dash_state = GF_DASH_STATE_CONNECTING;

//fallthrough

case GF_DASH_STATE_CONNECTING:
/*ask the user to connect to desired groups*/
e = dash->dash_io->on_dash_event(dash->dash_io, GF_DASH_EVENT_CREATE_PLAYBACK, -1, GF_OK);
Expand Down Expand Up @@ -8230,7 +8230,7 @@ static void gf_dash_seek_group(GF_DashClient *dash, GF_DASH_Group *group, Double
u32 first_downloaded, last_downloaded, segment_idx, orig_idx;

if (group->selection==GF_DASH_GROUP_NOT_SELECTABLE) return;

group->force_segment_switch = 0;
if (!is_dynamic) {
/*figure out where to seek*/
Expand Down Expand Up @@ -9360,7 +9360,7 @@ Bool gf_dash_in_last_period(GF_DashClient *dash, Bool check_eos)
default:
break;
}

if (dash->active_period_index+1 < gf_list_count(dash->mpd->periods))
return GF_FALSE;

Expand Down Expand Up @@ -10874,4 +10874,3 @@ void gf_dash_group_get_sar(GF_DashClient *dash, u32 group_idx, GF_Fraction *sar)
return;
}
#endif //GPAC_DISABLE_DASHIN

0 comments on commit b56ed1f

Please sign in to comment.