Search
SailfishOS Open Build Service
>
Projects
>
home:abranson
:
branches:nemo:devel:hw:native-common
>
gstreamer1.0-plugins-bad
> _service:tar_git:0006-jifmux-cope-with-missing-EOI-marker.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0006-jifmux-cope-with-missing-EOI-marker.patch of Package gstreamer1.0-plugins-bad
From e9770976f294a6ae34d8bd961087f65f157e0fbd Mon Sep 17 00:00:00 2001 From: Mohammed Hassan <mohammed.hassan@jolla.com> Date: Thu, 5 May 2016 03:39:57 +0300 Subject: [PATCH] jifmux: cope with missing EOI marker. If EOI marker is not within the last 5 bytes of the jpeg stream then we will fail to find it. Earlier versions of this patch scanned the whole stream, but it's simpler to just assume that the rest of the data is scan data. --- diff --git a/gst/jpegformat/gstjifmux.c b/gst/jpegformat/gstjifmux.c index 28638b7..4c66591 100644 --- a/gst/jpegformat/gstjifmux.c +++ b/gst/jpegformat/gstjifmux.c @@ -327,6 +327,7 @@ gst_jif_mux_parse_image (GstJifMux * self, GstBuffer * buf) if (marker == SOS) { gint eoi_pos = -1; + gboolean eoi_found = FALSE; gint i; /* search the last 5 bytes for the EOI marker */ @@ -334,6 +335,7 @@ gst_jif_mux_parse_image (GstJifMux * self, GstBuffer * buf) for (i = 5; i >= 2; i--) { if (map.data[map.size - i] == 0xFF && map.data[map.size - i + 1] == EOI) { eoi_pos = map.size - i; + eoi_found = TRUE; break; } } @@ -349,6 +351,10 @@ gst_jif_mux_parse_image (GstJifMux * self, GstBuffer * buf) goto error; GST_DEBUG_OBJECT (self, "scan data, size = %u", self->scan_size); + + /* If we cannot find EOI marker, we assume the rest of the data is scan data */ + if (!eoi_found) + goto done; } if (!gst_byte_reader_peek_uint8 (&reader, &marker)) -- 2.1.4