On Thu, Apr 22, 2021 at 02:02:33PM -0300, James Almer wrote: > With JPEG-LS PAL8 samples, the JPEG-LS extension parameters signaled with > the LSE marker show up after SOF but before SOS. For those, the pixel format > chosen by get_format() in SOF is GRAY8, and then replaced by PAL8 in LSE. > This has not been an issue given both pixel formats allocate the second data > plane for the palette, but after the upcoming soname bump, GRAY8 will no > longer > do that. This will result in segfauls when ff_jpegls_decode_lse() attempts to > write the palette on a buffer originally allocated as a GRAY8 one. > > Work around this by calling ff_get_buffer() after the actual pixel format is > known.
What if the LSE occurs after the SOS ? What if there are 2 LSE ? It seems allowed by the specification "The LSE marker segment may be present where tables or miscellaneous marker segments may appear. If tables specified in this marker segment for a given table ID appear more than once, each specification shall replace the previous specification." Maybe iam missing something but a implemenattion of this would seem to require scanning through the image, finding all LSE and checking if they all are compatible with the PAL8 format before allocating the image in SOF The implemenattion here which delays allocation slightly seems to make the code much more unstable allowing the frame configuration or allocation to be partly done, double done, redone, without the matching partner. Also it does not seem to implement the related specification completely. A complete implemenattion may reqire RGB24 or 48 to be selected in some cases like when each scan uses its own palette, which unless iam missing something seems allowed. But then maybe iam missing something, in which case please correct me! thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is what and why we do it that matters, not just one of them.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".