summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-06-22 10:49:50 +0100
committerTim-Philipp Müller <tim@centricular.com>2015-06-22 10:51:00 +0100
commit794c647f595dbb0bc9abcc6f40aa885a8079fcd6 (patch)
tree4162f84381b38371c0c7f1026c3d7fc3f60dd175
parent39d657c27476659c5f38acd93e5ff098bd84805a (diff)
irtspparse: reflow code to avoid uninitialized variable warning
This should hopefully allow even the most challenged static code analyzer to figure out that it's all fine. Also makes the flow clearer. https://bugzilla.gnome.org/show_bug.cgi?id=751305
-rw-r--r--gst/pcapparse/gstirtspparse.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gst/pcapparse/gstirtspparse.c b/gst/pcapparse/gstirtspparse.c
index 3c58bfda6..8f5f6f69b 100644
--- a/gst/pcapparse/gstirtspparse.c
+++ b/gst/pcapparse/gstirtspparse.c
@@ -163,7 +163,6 @@ gst_irtsp_parse_handle_frame (GstBaseParse * parse,
GstByteReader reader;
gint off;
GstMapInfo map;
- gboolean ret = FALSE;
guint framesize;
gst_buffer_map (buf, &map, GST_MAP_READ);
@@ -191,7 +190,6 @@ gst_irtsp_parse_handle_frame (GstBaseParse * parse,
framesize = GST_READ_UINT16_BE (map.data + 2) + 4;
GST_LOG_OBJECT (parse, "got frame size %d", framesize);
- ret = TRUE;
if (!gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD (parse))) {
GstCaps *caps;
@@ -201,10 +199,8 @@ gst_irtsp_parse_handle_frame (GstBaseParse * parse,
gst_caps_unref (caps);
}
-exit:
- gst_buffer_unmap (buf, &map);
-
- if (ret && framesize <= map.size) {
+ if (framesize <= map.size) {
+ gst_buffer_unmap (buf, &map);
/* HACK HACK skip header.
* could also ask baseparse to skip this,
* but that would give us a discontinuity for free
@@ -215,6 +211,8 @@ exit:
return gst_base_parse_finish_frame (parse, frame, framesize);
}
+exit:
+ gst_buffer_unmap (buf, &map);
return GST_FLOW_OK;
}