summaryrefslogtreecommitdiff
path: root/gst/audioparsers
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-09-04 17:06:39 +0200
committerEdward Hervey <bilboed@bilboed.com>2017-09-04 17:06:39 +0200
commit5bc5e07531e2496eab68fbfeab73b4d95f1709d3 (patch)
tree79f8cffaed81bc332f12b8579d7f426882fa03ba /gst/audioparsers
parent5cf368b36c7bea3b39b5414ddb6b475560b76675 (diff)
downloadgstreamer-plugins-good-5bc5e07531e2496eab68fbfeab73b4d95f1709d3.tar.gz
dcaparse: Really fix "usage before unmap"
Previous patch would try to unref a buffer that was pushed downstream. Instead only unref when/if needed and keep usage of the cleanup: goto block
Diffstat (limited to 'gst/audioparsers')
-rw-r--r--gst/audioparsers/gstdcaparse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gst/audioparsers/gstdcaparse.c b/gst/audioparsers/gstdcaparse.c
index a31f9d323..1ea40acda 100644
--- a/gst/audioparsers/gstdcaparse.c
+++ b/gst/audioparsers/gstdcaparse.c
@@ -446,6 +446,7 @@ gst_dca_parse_handle_frame (GstBaseParse * parse,
gst_base_parse_set_frame_rate (parse, rate, block_size, 0, 0);
}
+cleanup:
/* it is possible that DTS HD substream after DTS core */
if (parse->flags & GST_BASE_PARSE_FLAG_DRAINING || map.size >= size + 9) {
extra_size = 0;
@@ -469,18 +470,16 @@ gst_dca_parse_handle_frame (GstBaseParse * parse,
}
}
}
+ gst_buffer_unmap (buf, &map);
if (ret == GST_FLOW_OK && size + extra_size <= map.size) {
ret = gst_base_parse_finish_frame (parse, frame, size + extra_size);
} else {
ret = GST_FLOW_OK;
}
} else {
- ret = GST_FLOW_OK;
+ gst_buffer_unmap (buf, &map);
}
-cleanup:
- gst_buffer_unmap (buf, &map);
-
return ret;
}