Skip to content

Commit

Permalink
GB: Fix PSM parsing indicator bug. v5.0.134 (#3383)
Browse files Browse the repository at this point in the history
PICK a78936f

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
  • Loading branch information
3 people authored and winlinvip committed Jan 17, 2023
1 parent a4e7427 commit 9bf45be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 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 5.0 Changelog

* v5.0, 2023-01-17, Merge [#3383](https://github.com/ossrs/srs/pull/3383): GB: Fix PSM parsing indicator bug. v5.0.134 (#3383)
* v5.0, 2023-01-08, Merge [#3308](https://github.com/ossrs/srs/pull/3308): DVR: Improve file write performance by fwrite with cache. v5.0.133
* v5.0, 2023-01-06, DVR: Support blackbox test based on hooks. v5.0.132
* v5.0, 2023-01-06, FFmpeg: Support build with FFmpeg native opus. v5.0.131 (#3140)
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 133
#define VERSION_REVISION 134

#endif
15 changes: 8 additions & 7 deletions trunk/src/kernel/srs_kernel_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,18 @@ srs_error_t SrsPsPsmPacket::decode(SrsBuffer* stream)
return srs_error_new(ERROR_GB_PS_HEADER, "requires 4 only %d bytes", stream->left());
}

uint16_t r0 = stream->read_2bytes();
if ((r0&0x01) != 0x01) {
return srs_error_new(ERROR_GB_PS_HEADER, "invalid marker of 0x%#x", r0);
}

program_stream_map_version_ = (uint8_t)(r0&0x1f);
current_next_indicator_ = (uint8_t)((r0>>7) & 0x01);
uint8_t r0 = stream->read_1bytes();
program_stream_map_version_ = r0&0x1f;
current_next_indicator_ = (r0>>7) & 0x01;
if (!current_next_indicator_) {
return srs_error_new(ERROR_GB_PS_HEADER, "invalid indicator of 0x%#x", r0);
}

uint8_t r1 = stream->read_1bytes();
if ((r1&0x01) != 0x01) {
return srs_error_new(ERROR_GB_PS_HEADER, "invalid marker of 0x%#x", r1);
}

program_stream_info_length_ = stream->read_2bytes();
if (!stream->require(program_stream_info_length_)) {
return srs_error_new(ERROR_GB_PS_HEADER, "requires %d only %d bytes", program_stream_info_length_, stream->left());
Expand Down

0 comments on commit 9bf45be

Please sign in to comment.