summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-09-18 15:56:52 +0200
committerTim-Philipp Müller <tim@centricular.com>2015-06-21 11:28:38 +0100
commit41ed5c0266489f7247a8f6a2fc13bb4e0c73c516 (patch)
tree6bc8d8cc3eddee784f78a493bc99776e8aac1867
parentc83e413656f9c1e9918cfa00c53234327ac83071 (diff)
codecparsers: jpeg: fix calculation of segment size.
The size of a marker segment is defined to be exclusive of any initial marker code. So, fix the size for SOI, EOI and APPn segments but also the size of any possible segment that is usually "reserved" or not explicitly defined. https://bugzilla.gnome.org/show_bug.cgi?id=707447
-rw-r--r--gst-libs/gst/codecparsers/gstjpegparser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/gst/codecparsers/gstjpegparser.c b/gst-libs/gst/codecparsers/gstjpegparser.c
index 8ee2d449e..ac1ba9a49 100644
--- a/gst-libs/gst/codecparsers/gstjpegparser.c
+++ b/gst-libs/gst/codecparsers/gstjpegparser.c
@@ -222,7 +222,7 @@ jpeg_parse_to_next_marker (GstByteReader * br, guint8 * marker)
if (marker)
*marker = br->data[ofs + 1];
- gst_byte_reader_skip (br, ofs - br->byte + 2);
+ gst_byte_reader_skip_unchecked (br, ofs - br->byte);
return TRUE;
}
@@ -558,6 +558,7 @@ gst_jpeg_parse (GstJpegMarkerSegment * seg,
return FALSE;
}
+ gst_byte_reader_skip_unchecked (&br, 2);
seg->offset = offset + gst_byte_reader_get_pos (&br);
seg->size = -1;
@@ -566,7 +567,7 @@ gst_jpeg_parse (GstJpegMarkerSegment * seg,
case GST_JPEG_MARKER_SOI:
case GST_JPEG_MARKER_EOI:
fixed_size_segment:
- seg->size = 2;
+ seg->size = 0;
break;
case (GST_JPEG_MARKER_SOF_MIN + 0): /* Lf */