You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LibJpegWrap follow-ups from the review of #2 (Rgb24 codec) #3
Possible double free on the encode error path: in EncodeRgb24, if libjpeg-turbo's jpeg_mem_dest has grown its buffer and an error then longjmps out, free(mem) may free a buffer that empty_mem_output_buffer already freed. The caller's mem is only updated in term_destination. Track the current buffer explicitly, or use a custom destination manager over the caller's buffer.
A truncated scan decodes as success: libjpeg treats premature end of data as a warning and fills the rest with gray, so DecodeRgb24 (and the Gray8/I420 decoders) return a full frame. Consider failing when num_warnings > 0, or exposing the warning count.
int overflow on huge sizes:MaxJpegSize uses checked and throws, but width * height * 3 in DecodeRgb24 (and FrameHeader lengths elsewhere) can overflow int for very large images. Validate the dimensions before allocating.
Also outside this list: the linux-arm64 and win-x64 LibJpegWrap binaries lack the Rgb24 exports, so the managed calls throw NotSupportedException there until those binaries are rebuilt.
Activity