Prevent bad memory access when reading specific Jpeg files.  #1365
Prevent bad memory access when reading specific Jpeg files.  #1365

The issue was caused by some applications not putting a proper
NULL-terminator to the comment marker when saving an image.
This will cause std::string to access memory past the marker's
data when calculating string length.

Now we pass length of string stored in the marker explicitly, so
there's no need to call strlen() on a random memory.

While it's arguably that applications should put null-terminator
to the comment, there are enough textures in online libraries
which doesn't have null-terminator in the comment string and there's
need to crash on those at all.

lgritz/oiio,lgritz/oiio,YangYangTL/oiio,OpenImageIO/oiio,YangYangTL/oiio,YangYangTL/oiio,micler/oiio,OpenImageIO/oiio,bdeluca/oiio,bdeluca/oiio,micler/oiio,OpenImageIO/oiio,bdeluca/oiio,lgritz/oiio,micler/oiio,micler/oiio,lgritz/oiio,bdeluca/oiio,YangYangTL/oiio,OpenImageIO/oiio