Skip to content

Commit

Permalink
fix: gcc segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Jul 26, 2024
1 parent 05005e5 commit 5dcad27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flaca/src/image/jpegtran.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ impl<'a> From<&'a [u8]> for JpegSrcInfo<'a> {
// Set up the error, then the struct.
out.cinfo.common.err = std::ptr::addr_of_mut!(*out.err);
jpeg_create_decompress(&mut out.cinfo);
out.cinfo.common.progress = std::ptr::null_mut();
}

out
Expand Down Expand Up @@ -296,6 +297,7 @@ impl From<&mut JpegSrcInfo<'_>> for JpegDstInfo {
// Set up the error, then the struct.
out.cinfo.common.err = std::ptr::addr_of_mut!(*out.err);
jpeg_create_compress(&mut out.cinfo);
out.cinfo.common.progress = std::ptr::null_mut();

// Sync the source trace level with the destination.
src.err.trace_level = (*out.err).trace_level;
Expand Down

0 comments on commit 5dcad27

Please sign in to comment.