When jpeg_finish_decompress is called, output state reference is being created.
But if there is any failures in finishing decompress, it jumps to setjmp,
and at that point state was not referenced. Resulting in leak of output state.
Hence adding another setjmp after output state is referenced.
Similarly adding another setjmp to unmap the frame in case error happens before
finish_decompress
https://bugzilla.gnome.org/show_bug.cgi?id=753087
GST_MAP_READWRITE))
goto alloc_failed;
+ if (setjmp (dec->jerr.setjmp_buffer)) {
+ code = dec->jerr.pub.msg_code;
+ gst_video_frame_unmap (&vframe);
+ goto decode_error;
+ }
+
GST_LOG_OBJECT (dec, "width %d, height %d", width, height);
if (dec->cinfo.jpeg_color_space == JCS_RGB) {
gst_video_frame_unmap (&vframe);
+ if (setjmp (dec->jerr.setjmp_buffer)) {
+ code = dec->jerr.pub.msg_code;
+ goto decode_error;
+ }
+
GST_LOG_OBJECT (dec, "decompressing finished");
jpeg_finish_decompress (&dec->cinfo);