va: jpegdecoder: Do not check SOS state when parsing DRI marker.
authorHe Junyan <junyan.he@intel.com>
Sun, 12 Feb 2023 08:11:34 +0000 (16:11 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 18 Jul 2023 10:30:57 +0000 (12:30 +0200)
According to spec, the JPEG_MARKER_DRI(Restart interval definition)
marker can come before the SOS marker. So we should not check the SOS
state when parsing the DRI marker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5053>

subprojects/gst-plugins-bad/sys/va/gstjpegdecoder.c

index ce2c67d..2448c3c 100644 (file)
@@ -481,9 +481,10 @@ gst_jpeg_decoder_handle_frame (GstVideoDecoder * decoder,
         break;
 
       case GST_JPEG_MARKER_DRI:
-        if (!(valid_state (priv->state, GST_JPEG_DECODER_STATE_GOT_SOS)
-                && decode_restart_interval (self, &seg)))
+        if (!decode_restart_interval (self, &seg)) {
+          GST_WARNING_OBJECT (self, "Fail to decode restart interval");
           goto unmap_and_error;
+        }
         break;
       case GST_JPEG_MARKER_DNL:
         break;