Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions trunk/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The changelog for SRS.

## SRS 6.0 Changelog

* v6.0, 2023-07-01, Merge [#3605](https://github.com/ossrs/srs/pull/3605): BugFix: Resolve the problem of srs_error_t memory leak. v6.0.57 (#3605)
* v6.0, 2023-06-30, Merge [#3596](https://github.com/ossrs/srs/pull/3596): Improve the usage of "transcode" in the "full.conf" file. v6.0.56 (#3596)
* v6.0, 2023-06-21, Merge [#3551](https://github.com/ossrs/srs/pull/3551): H264: Fix H.264 ISOM reserved bit value. v6.0.55 (#3551)
* v6.0, 2023-06-20, Merge [#3594](https://github.com/ossrs/srs/pull/3594): Docker: Refine the main dockerfile. v6.0.54 (#3592)
Expand Down Expand Up @@ -70,6 +71,7 @@ The changelog for SRS.

## SRS 5.0 Changelog

* v5.0, 2023-07-01, Merge [#3605](https://github.com/ossrs/srs/pull/3605): BugFix: Resolve the problem of srs_error_t memory leak. v5.0.163 (#3605)
* v5.0, 2023-06-30, Merge [#3596](https://github.com/ossrs/srs/pull/3596): Improve the usage of "transcode" in the "full.conf" file. v5.0.162 (#3596)
* v5.0, 2023-06-21, Merge [#3551](https://github.com/ossrs/srs/pull/3551): H264: Fix H.264 ISOM reserved bit value. v5.0.161 (#3551)
* v5.0, 2023-06-20, Merge [#3592](https://github.com/ossrs/srs/pull/3592): Fix Permission Issue in depend.sh for OpenSSL Compilation. v5.0.159 (#3592)
Expand Down
1 change: 1 addition & 0 deletions trunk/src/app/srs_app_dvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ void SrsDvrSessionPlan::on_unpublish()
srs_error_t err = segment->close();
if (err != srs_success) {
srs_warn("ignore flv close error %s", srs_error_desc(err).c_str());
srs_error_reset(err);
}

dvr_enabled = false;
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 162
#define VERSION_REVISION 163

#endif
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version6.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#define VERSION_MAJOR 6
#define VERSION_MINOR 0
#define VERSION_REVISION 56
#define VERSION_REVISION 57

#endif
6 changes: 3 additions & 3 deletions trunk/src/protocol/srs_protocol_raw_avc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand All @@ -420,15 +420,15 @@ 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.
// @see Section 7.3.2.2 ("Sequence parameter set RBSP syntax") of the H.265
// @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());
}
}

Expand Down