Merge pull request #1 from rouault/associated_data_support

Run astyle
This commit is contained in:
Håkan Wiman 2018-04-11 11:50:24 +02:00 committed by GitHub
commit ae71bb88a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 50 deletions

View File

@ -2676,7 +2676,8 @@ static OPJ_BOOL opj_jp2_read_asoc( opj_jp2_t *jp2,
assert(p_manager != 00); assert(p_manager != 00);
if (p_header_size < 8) { if (p_header_size < 8) {
opj_event_msg(p_manager, EVT_ERROR, "Cannot handle ASOC box of less than 8 bytes\n"); opj_event_msg(p_manager, EVT_ERROR,
"Cannot handle ASOC box of less than 8 bytes\n");
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -2685,7 +2686,8 @@ static OPJ_BOOL opj_jp2_read_asoc( opj_jp2_t *jp2,
p_header_size -= 4; p_header_size -= 4;
if (p_header_size < asoc_size) { if (p_header_size < asoc_size) {
opj_event_msg(p_manager, EVT_ERROR, "ASOC super box is smaller than containing sub box\n"); opj_event_msg(p_manager, EVT_ERROR,
"ASOC super box is smaller than containing sub box\n");
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -2696,7 +2698,8 @@ static OPJ_BOOL opj_jp2_read_asoc( opj_jp2_t *jp2,
if (label_tag != JP2_LBL) { if (label_tag != JP2_LBL) {
/* TODO: Verify that ASOC must have a following label ? */ /* TODO: Verify that ASOC must have a following label ? */
opj_event_msg(p_manager, EVT_WARNING, "ASOC data does not have a label (LBL)\n"); opj_event_msg(p_manager, EVT_WARNING,
"ASOC data does not have a label (LBL)\n");
return OPJ_TRUE; // No error if we could not parse return OPJ_TRUE; // No error if we could not parse
} }
@ -2711,7 +2714,8 @@ static OPJ_BOOL opj_jp2_read_asoc( opj_jp2_t *jp2,
} }
asoc = &(jp2->asoc[jp2->numasoc - 1]); asoc = &(jp2->asoc[jp2->numasoc - 1]);
asoc->level = jp2->numasoc-1; /* TODO: This is not correct if a parent asoc contains multiple child asocs! */ asoc->level = jp2->numasoc -
1; /* TODO: This is not correct if a parent asoc contains multiple child asocs! */
asoc->label_length = asoc_size + 1; asoc->label_length = asoc_size + 1;
asoc->label = opj_malloc(asoc_size); asoc->label = opj_malloc(asoc_size);
memcpy(asoc->label, p_header_data, asoc_size); memcpy(asoc->label, p_header_data, asoc_size);
@ -2723,7 +2727,8 @@ static OPJ_BOOL opj_jp2_read_asoc( opj_jp2_t *jp2,
p_header_size -= asoc_size; p_header_size -= asoc_size;
if (p_header_size < 4) { if (p_header_size < 4) {
opj_event_msg(p_manager, EVT_ERROR, "Cannot handle ASOC sub box of less than 4 bytes\n"); opj_event_msg(p_manager, EVT_ERROR,
"Cannot handle ASOC sub box of less than 4 bytes\n");
return OPJ_FALSE; return OPJ_FALSE;
} }

View File

@ -961,7 +961,8 @@ void OPJ_CALLCONV opj_dump_associated_data(
if (cstr_info->asoc_info) { if (cstr_info->asoc_info) {
fprintf(output_stream, "\n\nAssociated data: {\n"); fprintf(output_stream, "\n\nAssociated data: {\n");
for (i = 0; i < cstr_info->nbasoc; i++) { for (i = 0; i < cstr_info->nbasoc; i++) {
fprintf(output_stream, "\tlabel=%s, xml/data=", (char*) cstr_info->asoc_info[i].label); fprintf(output_stream, "\tlabel=%s, xml/data=",
(char*) cstr_info->asoc_info[i].label);
if (cstr_info->asoc_info[i].xml_buf) { if (cstr_info->asoc_info[i].xml_buf) {
fprintf(output_stream, "%s\n", (char*) cstr_info->asoc_info[i].xml_buf); fprintf(output_stream, "%s\n", (char*) cstr_info->asoc_info[i].xml_buf);
} else { } else {