Commit 5590ab45 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: Check best_effort_timestamp after rescale

Fixes integer overflow
Fixes: Ticket5126
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5f5467e7
...@@ -2123,8 +2123,12 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output) ...@@ -2123,8 +2123,12 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
ist->hwaccel_retrieved_pix_fmt = decoded_frame->format; ist->hwaccel_retrieved_pix_fmt = decoded_frame->format;
best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame); best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame);
if(best_effort_timestamp != AV_NOPTS_VALUE) if(best_effort_timestamp != AV_NOPTS_VALUE) {
ist->next_pts = ist->pts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q); int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q);
if (ts != AV_NOPTS_VALUE)
ist->next_pts = ist->pts = ts;
}
if (debug_ts) { if (debug_ts) {
av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video " av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment