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

修复两个无符号int值的差值强转为有符号int发生溢出导致出现pts为负值,导致触发后续断言检查pts不能为负值的处理 #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions librtsp/source/utils/rtsp-demuxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static inline int rtsp_demuxer_onrtppacket(void* param, const void* data, int by
if (0 == pt->last && INT64_MIN == pt->pts)
pt->timestamp = timestamp;
else
pt->timestamp += (int32_t)(timestamp - pt->last);
pt->timestamp += (int64_t)(timestamp - pt->last);
pt->last = timestamp;
pt->pts = pt->timestamp * 1000 / pt->frequency;

Expand All @@ -318,7 +318,7 @@ static inline int rtsp_demuxer_onh2645nalu(void* param, const void* data, int by
if (0 == pt->last && INT64_MIN == pt->pts)
pt->timestamp = timestamp;
else
pt->timestamp += (int32_t)(timestamp - pt->last);
pt->timestamp += (int64_t)(timestamp - pt->last);
pt->last = timestamp;
pt->pts = pt->timestamp * 1000 / pt->frequency;

Expand Down