This happens because the metadata tag is not correctly formed. In the following post i'll show how to correct such files.
Step 1. Add 6 to the metadata tag's size field.
- Size of the metadata tag is written 3 bytes, starting from the 15th byte. This is an integer stored in big endian format. Replace this size by size + 6. (in big endian).
Step 1: Location of the size field
Step 1: Size field after adding 6 to it
Step 2: Add 6 bytes at the end of the metadata tag.
- To reach boundary of the end of metadata and the starting of the first tag, search for the following hex string '0x00 0x00 0x00 0x00 0x08'. The first 4 bytes are the end of the metadata tag (called the 'previous tag size') and '0x08' is the starting of the next tag.
Step 2: Search the end of the metadata tag.
Step 2: Add the 'object end markers'
Step 3: Correct the 'previous tag size', for the metadata tag. This should contain a value = new metadata size + 11. This should be an integer and should be written in big endian.
Step 3: Correct the 'previous tag size'.
That's it!