summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-08-06 14:33:54 +1000
committerJan Schmidt <jan@centricular.com>2015-08-15 15:39:23 +1000
commitfdac09d843f6fed06f222485e8f43959430d994a (patch)
treed32a87acba262472ba4a2a50b86e034b89bcbd56 /gst-libs
parent7a2f5d6b030e414f5d662eb73eb7849e9a5a4a1e (diff)
downloadgstreamer-plugins-bad-fdac09d843f6fed06f222485e8f43959430d994a.tar.gz
h264parse: Clear SPS info after processing.
The SPS struct might be filled out by a call to gst_h264_parser_parse_subset_sps, which fills out dynamically allocated data and requires a call to gst_h264_sps_clear() to free it. Also make sure to clear out any allocated SPS data when returning an error. https://bugzilla.gnome.org/show_bug.cgi?id=753306
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index 2648194ad..4092acbb2 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -1845,8 +1845,10 @@ gst_h264_parser_parse_subset_sps (GstH264NalParser * nalparser,
if (res == GST_H264_PARSER_OK) {
GST_DEBUG ("adding sequence parameter set with id: %d to array", sps->id);
- if (!gst_h264_sps_copy (&nalparser->sps[sps->id], sps))
+ if (!gst_h264_sps_copy (&nalparser->sps[sps->id], sps)) {
+ gst_h264_sps_clear (sps);
return GST_H264_PARSER_ERROR;
+ }
nalparser->last_sps = &nalparser->sps[sps->id];
}
return res;
@@ -1899,6 +1901,7 @@ gst_h264_parse_subset_sps (GstH264NalUnit * nalu, GstH264SPS * sps,
error:
GST_WARNING ("error parsing \"Subset sequence parameter set\"");
+ gst_h264_sps_clear (sps);
sps->valid = FALSE;
return GST_H264_PARSER_ERROR;
}