mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
Revert "pngparse: improve parsing of the image"
This reverts commit 59e7f0597d
.
This patch should not have been pushed, see
https://bugzilla.gnome.org/show_bug.cgi?id=740058#c3
This commit is contained in:
parent
1e287b6fd7
commit
854630fb92
2 changed files with 1 additions and 9 deletions
|
@ -130,7 +130,7 @@ gst_png_parse_handle_frame (GstBaseParse * parse,
|
||||||
GstByteReader reader;
|
GstByteReader reader;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
guint64 signature;
|
guint64 signature;
|
||||||
static guint width = 0, height = 0;
|
guint width = 0, height = 0;
|
||||||
|
|
||||||
gst_buffer_map (frame->buffer, &map, GST_MAP_READ);
|
gst_buffer_map (frame->buffer, &map, GST_MAP_READ);
|
||||||
gst_byte_reader_init (&reader, map.data, map.size);
|
gst_byte_reader_init (&reader, map.data, map.size);
|
||||||
|
@ -165,8 +165,6 @@ gst_png_parse_handle_frame (GstBaseParse * parse,
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_byte_reader_skip (&reader, 8);
|
gst_byte_reader_skip (&reader, 8);
|
||||||
/* Skipping the data read in previous iterations */
|
|
||||||
gst_byte_reader_skip (&reader, pngparse->skip_length);
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
guint32 length;
|
guint32 length;
|
||||||
|
@ -193,8 +191,6 @@ gst_png_parse_handle_frame (GstBaseParse * parse,
|
||||||
|
|
||||||
if (!gst_byte_reader_skip (&reader, length + 4))
|
if (!gst_byte_reader_skip (&reader, length + 4))
|
||||||
goto beach;
|
goto beach;
|
||||||
/* We have already read the data till now. Hence skip the read data next time we enter handle_frame() */
|
|
||||||
pngparse->skip_length = gst_byte_reader_get_pos (&reader) + length + 4;
|
|
||||||
|
|
||||||
if (code == GST_MAKE_FOURCC ('I', 'E', 'N', 'D')) {
|
if (code == GST_MAKE_FOURCC ('I', 'E', 'N', 'D')) {
|
||||||
/* the start code and at least 2 empty frames (IHDR and IEND) */
|
/* the start code and at least 2 empty frames (IHDR and IEND) */
|
||||||
|
@ -238,9 +234,6 @@ gst_png_parse_handle_frame (GstBaseParse * parse,
|
||||||
|
|
||||||
|
|
||||||
gst_buffer_unmap (frame->buffer, &map);
|
gst_buffer_unmap (frame->buffer, &map);
|
||||||
pngparse->skip_length = 0;
|
|
||||||
width = 0;
|
|
||||||
height = 0;
|
|
||||||
return gst_base_parse_finish_frame (parse, frame,
|
return gst_base_parse_finish_frame (parse, frame,
|
||||||
gst_byte_reader_get_pos (&reader));
|
gst_byte_reader_get_pos (&reader));
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ struct _GstPngParse
|
||||||
|
|
||||||
guint width;
|
guint width;
|
||||||
guint height;
|
guint height;
|
||||||
guint32 skip_length;
|
|
||||||
|
|
||||||
gboolean sent_codec_tag;
|
gboolean sent_codec_tag;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue