1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

BugFix: Resolve the problem of srs_error_t memory leak. v5.0.163, v6.0.57 (#3605)

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
wangzhen 2023-07-01 18:46:59 +08:00 committed by GitHub
parent 7ba59c3635
commit fe230365ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View file

@ -409,7 +409,7 @@ srs_error_t SrsRawHEVCStream::mux_sequence_header(std::string vps, std::string s
SrsFormat format;
if ((err = format.initialize()) != srs_success) {
return srs_error_new(ERROR_STREAM_CASTER_HEVC_FORMAT, "format failed");
return srs_error_wrap(err, "format failed");
}
// hevc_dec_conf_record
SrsHevcDecoderConfigurationRecord *hevc_info = &format.vcodec->hevc_dec_conf_record_;
@ -420,7 +420,7 @@ srs_error_t SrsRawHEVCStream::mux_sequence_header(std::string vps, std::string s
// @doc ITU-T-H.265-2021.pdf, page 54.
SrsBuffer vps_stream((char*)vps.data(), vps.length());
if ((err = format.hevc_demux_vps(&vps_stream)) != srs_success) {
return srs_error_new(ERROR_STREAM_CASTER_HEVC_VPS, "vps demux failed, len=%d", vps.length());
return srs_error_wrap(err, "vps demux failed, len=%d", vps.length());
}
// H265 SPS Nal Unit (seq_parameter_set_rbsp()) parser.
@ -428,7 +428,7 @@ srs_error_t SrsRawHEVCStream::mux_sequence_header(std::string vps, std::string s
// @doc ITU-T-H.265-2021.pdf, page 55.
SrsBuffer sps_stream((char*)sps.data(), sps.length());
if ((err = format.hevc_demux_sps(&sps_stream)) != srs_success) {
return srs_error_new(ERROR_STREAM_CASTER_HEVC_SPS, "sps demux failed, len=%d",sps.length());
return srs_error_wrap(err, "sps demux failed, len=%d",sps.length());
}
}