Fixes integer overflow
Fixes: Ticket5126
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -2123,8 +2123,12 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output) |
2123 | 2123 |
ist->hwaccel_retrieved_pix_fmt = decoded_frame->format; |
2124 | 2124 |
|
2125 | 2125 |
best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame); |
2126 |
- if(best_effort_timestamp != AV_NOPTS_VALUE) |
|
2127 |
- ist->next_pts = ist->pts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q); |
|
2126 |
+ if(best_effort_timestamp != AV_NOPTS_VALUE) { |
|
2127 |
+ int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q); |
|
2128 |
+ |
|
2129 |
+ if (ts != AV_NOPTS_VALUE) |
|
2130 |
+ ist->next_pts = ist->pts = ts; |
|
2131 |
+ } |
|
2128 | 2132 |
|
2129 | 2133 |
if (debug_ts) { |
2130 | 2134 |
av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video " |