Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/epr_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,29 @@ int epr_set_dyn_dddb_params(EPR_SProductId* product_id)
}

field = epr_get_field(product_id->sph_record, "LINE_LENGTH");
if (field == NULL) {
epr_set_err(e_err_invalid_value,
"epr_set_param: wrong SPH: unable to read LINE_LENGTH");
epr_free_string(tmp);
return 0;
}

line_length = ((uint*) field->elems)[0];
if (line_length == 0) {
epr_set_err(e_err_invalid_value,
"epr_set_param: wrong SPH: LINE_LENGTH must be > 0");
epr_free_string(tmp);
return 0;
}

field = epr_get_field(product_id->sph_record, "LINES_PER_TIE_PT");
if (field == NULL) {
epr_set_err(e_err_invalid_value,
"epr_set_param: wrong SPH: unable to read LINES_PER_TIE_PT");
epr_free_string(tmp);
return 0;
}

num_tie_points_across = ((uint*) field->elems)[0];
if (num_tie_points_across == 0) {
epr_set_err(e_err_invalid_value,
Expand All @@ -180,6 +195,13 @@ int epr_set_dyn_dddb_params(EPR_SProductId* product_id)
else if (strcmp(EPR_ENVISAT_PRODUCT_ASAR, epr_sub_string((char*)product_field->elems, 0, 3)) == 0) {

field = epr_get_field(product_id->sph_record, "LINE_LENGTH");
if (field == NULL) {
epr_set_err(e_err_invalid_value,
"epr_set_param: wrong SPH: unable to read LINE_LENGTH");
epr_free_string(tmp);
return 0;
}

line_length = ((uint*) field->elems)[0];
if (line_length == 0) {
epr_set_err(e_err_invalid_value,
Expand Down