1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00

add checking for pes_parse

This commit is contained in:
runner365 2020-03-01 19:42:32 +08:00
parent 72155fc645
commit 40a09958c4

View file

@ -265,7 +265,11 @@ int ts_demux::decode_unit(unsigned char* data_p, std::string key_path, TS_DATA_C
//callback last media data in data buffer
on_callback(callback, _last_pid, key_path, _last_dts, _last_pts);
pes_parse(data_p+npos, npos, &ret_data_p, ret_size, dts, pts);
int ret = pes_parse(data_p+npos, npos, &ret_data_p, ret_size, dts, pts);
assert(ret <= 188);
if (ret > 188) {
return -1;
}
_last_pts = pts;
_last_dts = (dts == 0) ? pts : dts;