Set the size of an JpegImageData section with no terminator to the remainder of the stream,
on the assumption that the file is truncated in the middle of the JpegImageData and so the rest
of the file is its data. This avoids the JpegImageData being parsed to calculate it's size,
and hopefully prevents the corrupted section needing to be parsed at all for most operations.
If the JpegImageData is explicitly parsed the memory blowup and parsing errors will still happen,
but that seems like the expected outcome of parsing a large corrupt section rather than a surprise
that happens when checking for fields.
Suggested fix for #67.
Set the size of an JpegImageData section with no terminator to the remainder of the stream, on the assumption that the file is truncated in the middle of the JpegImageData and so the rest of the file is its data. This avoids the JpegImageData being parsed to calculate it's size, and hopefully prevents the corrupted section needing to be parsed at all for most operations.
If the JpegImageData is explicitly parsed the memory blowup and parsing errors will still happen, but that seems like the expected outcome of parsing a large corrupt section rather than a surprise that happens when checking for fields.