summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-07-05 11:48:08 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-07-05 11:54:25 +0200
commit3a1d0b7a0f267a649a3d2227b545feae6e567dd6 (patch)
treeff6e46be9d76a922c01cba568bac114820f80a5e
parent3e4eacce3c61a886c5ea6767702f8b6a2a8a2d7c (diff)
jpegparse: fix skipping extra 0xff markers
In particular, this makes the jpegparse unit test pass again. Also add a debug statement. Fixes #622690.
-rw-r--r--gst/jpegformat/gstjpegparse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c
index 3543ab232..22d6407e0 100644
--- a/gst/jpegformat/gstjpegparse.c
+++ b/gst/jpegformat/gstjpegparse.c
@@ -329,7 +329,7 @@ gst_jpeg_parse_get_image_length (GstJpegParse * parse)
/* may have marker, but could have been resyncng */
resync = resync || parse->priv->last_resync;
/* Skip over extra 0xff */
- while ((noffset > 0) && ((value & 0xff) == 0xff)) {
+ while ((noffset >= 0) && ((value & 0xff) == 0xff)) {
noffset++;
noffset =
gst_adapter_masked_scan_uint32_peek (adapter, 0x0000ff00, 0x0000ff00,
@@ -833,6 +833,8 @@ gst_jpeg_parse_chain (GstPad * pad, GstBuffer * buf)
if (len == 0)
return GST_FLOW_OK;
+ GST_LOG_OBJECT (parse, "parsed image of size %d", len);
+
/* now we have enough in the adapter to process a full jpeg image */
ret = gst_jpeg_parse_push_buffer (parse, len);
}