mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112 (#3323)
* SRT: fix crash when sps/pps empty. v5.0.112 Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
56040cab42
commit
09a96175e8
4 changed files with 12 additions and 2 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 5.0 Changelog
|
||||
|
||||
* v5.0, 2022-12-17, Merge [#3323](https://github.com/ossrs/srs/pull/3323): SRT: Fix srt to rtmp crash when sps or pps empty. v5.0.112
|
||||
* v5.0, 2022-12-15, For [#3300](https://github.com/ossrs/srs/issues/3300): GB28181: Fix memory overlap for small packets. v5.0.111
|
||||
* v5.0, 2022-12-14, For [#939](https://github.com/ossrs/srs/issues/939): FLV: Support set default has_av and disable guessing. v5.0.110
|
||||
* v5.0, 2022-12-13, For [#939](https://github.com/ossrs/srs/issues/939): FLV: Drop packet if header flag is not matched. v5.0.109
|
||||
|
|
|
@ -377,6 +377,10 @@ srs_error_t SrsRtmpFromSrtBridge::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs)
|
|||
if ((err = avc->annexb_demux(avs, &frame, &frame_size)) != srs_success) {
|
||||
return srs_error_wrap(err, "demux annexb");
|
||||
}
|
||||
|
||||
if (frame == NULL || frame_size == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// for sps
|
||||
if (avc->is_sps(frame, frame_size)) {
|
||||
|
@ -426,6 +430,10 @@ srs_error_t SrsRtmpFromSrtBridge::check_sps_pps_change(SrsTsMessage* msg)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (sps_.empty() || pps_.empty()) {
|
||||
return srs_error_new(ERROR_SRT_TO_RTMP_EMPTY_SPS_PPS, "sps or pps empty");
|
||||
}
|
||||
|
||||
// sps/pps changed, generate new video sh frame and dispatch it.
|
||||
sps_pps_change_ = false;
|
||||
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 111
|
||||
#define VERSION_REVISION 112
|
||||
|
||||
#endif
|
||||
|
|
|
@ -370,7 +370,8 @@
|
|||
XX(ERROR_SRT_CONN , 6006, "SrtConnection", "SRT connectin level error") \
|
||||
XX(ERROR_SRT_SOURCE_BUSY , 6007, "SrtStreamBusy", "SRT stream already exists or busy") \
|
||||
XX(ERROR_RTMP_TO_SRT , 6008, "SrtFromRtmp", "Covert RTMP to SRT failed") \
|
||||
XX(ERROR_SRT_STATS , 6009, "SrtStats", "SRT get statistic data failed")
|
||||
XX(ERROR_SRT_STATS , 6009, "SrtStats", "SRT get statistic data failed") \
|
||||
XX(ERROR_SRT_TO_RTMP_EMPTY_SPS_PPS , 6010, "SrtToRtmpEmptySpsPps", "SRT to rtmp have empty sps or pps")
|
||||
|
||||
/**************************************************/
|
||||
/* For user-define error. */
|
||||
|
|
Loading…
Reference in a new issue