Skip to content

Malformed BANDSB TRE plugin #628

@avemuganti

Description

@avemuganti

The BANDSB TRE plugin (found in BANDSBTreNitroPlugin.c) appears to be malformed, and doesn't work properly when the last bit of EXISTENCE_MASK is set to 1.

Below is a code snippet from this plugin. I've added some comments by the NITF_ENDLOOPs to show which loop is being ended. Notice that there is an extra NITF_ENDLOOP!

{NITF_IF, 0, "& 0x00000001", "EXISTENCE_MASK" },
{NITF_BCS_N, 2,  "Number of Auxiliary Band Level Parameters (m)",       "NUM_AUX_B" },
{NITF_BCS_N, 2,  "Number of Auxiliary Cube Level Parameters (k)",       "NUM_AUX_C" },

{NITF_LOOP, 0, NULL, "NUM_AUX_B" },

{NITF_BCS_A, 1,  "Band Auxiliary Parameter Value Format",               "BAPF" },
{NITF_BCS_A, 7,  "Unit of Band Auxiliary Parameter",                    "UBAP" },

{NITF_LOOP, 0, NULL, "COUNT" },

{NITF_IF, 0, "eq I", "BAPF" },
{NITF_BCS_N, 10, "Auxiliary Parameter Integer Value",                   "APN" },
{NITF_ENDIF, 0, NULL, NULL},
{NITF_IF, 0, "eq R", "BAPF" },
{NITF_BINARY, 4, "Auxiliary Parameter Real Value",                      "APR" },
{NITF_ENDIF, 0, NULL, NULL},
{NITF_IF, 0, "eq A", "BAPF" },
{NITF_BCS_N, 20, "Auxiliary Parameter ASCII Value",                     "APA" },
{NITF_ENDIF, 0, NULL, NULL},

{NITF_ENDLOOP, 0, NULL, NULL }, // COUNT
{NITF_ENDLOOP, 0, NULL, NULL }, // NUM_AUX_B

{NITF_LOOP, 0, NULL, "NUM_AUX_C" },

{NITF_BCS_A, 1,  "Cube Auxiliary Parameter Value Format",               "CAPF" },
{NITF_BCS_A, 7,  "Unit of Cube Auxiliary Parameter",                    "UCAP" },
{NITF_IF, 0, "eq I", "CAPF" },
{NITF_BCS_N, 10, "Auxiliary Parameter Integer Value",                   "APN" },
{NITF_ENDIF, 0, NULL, NULL},
{NITF_IF, 0, "eq R", "CAPF" },
{NITF_BINARY, 4, "Auxiliary Parameter Real Value",                      "APR" },
{NITF_ENDIF, 0, NULL, NULL},
{NITF_IF, 0, "eq A", "CAPF" },
{NITF_BCS_N, 20, "Auxiliary Parameter ASCII Value",                     "APA" },
{NITF_ENDIF, 0, NULL, NULL},

{NITF_ENDLOOP, 0, NULL, NULL }, // NUM_AUX_C
{NITF_ENDLOOP, 0, NULL, NULL }, // **** THINGS GO WRONG HERE: THIS IS EXTRA! ****

{NITF_ENDIF, 0, NULL, NULL},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions