diff options
-rw-r--r-- | gst-libs/gst/codecparsers/gsth264parser.c | 5 | ||||
-rw-r--r-- | gst/videoparsers/gsth264parse.c | 1 |
2 files changed, 5 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; } diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 5bbcc0634..bd0162560 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -746,6 +746,7 @@ gst_h264_parse_process_nal (GstH264Parse * h264parse, GstH264NalUnit * nalu) } gst_h264_parser_store_nal (h264parse, sps.id, nal_type, nalu); + gst_h264_sps_clear (&sps); h264parse->state |= GST_H264_PARSE_STATE_GOT_SPS; h264parse->header |= TRUE; break; |