incomplete_len 在大华摄像头下,因为大华包头对音频的不标准处理,可能为负值,而sizeof(SrsPsPacketStartCode) 返回的是unsigned 类型, 因些增加判断 (#2039)

Co-authored-by: jesse.xi <jj.xi@tianrang-inc.com>
pull/2042/head
Jesse Xi 4 years ago committed by GitHub
parent c779d95246
commit 8515f5a91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -954,7 +954,8 @@ srs_error_t SrsPsStreamDemixer::on_ps_stream(char* ps_data, int ps_size, uint32_
ps_fw.write(ps_data, ps_size, NULL);
#endif
while(incomplete_len >= sizeof(SrsPsPacketStartCode))
while(incomplete_len > 0
&& incomplete_len >= sizeof(SrsPsPacketStartCode))
{
if (next_ps_pack
&& next_ps_pack[0] == (char)0x00

Loading…
Cancel
Save