Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-18 03:07:33 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-02-18 03:46:59 +0300
commit5590ab45e0b1cd45e48580608f99615ad0a429b8 (patch)
treefdf71296c9bb3123a21ff30256d9e0c881b483bf /ffmpeg.c
parent5f5467e749f969b71ec247af88698cb8056e77e5 (diff)
ffmpeg: Check best_effort_timestamp after rescale
Fixes integer overflow Fixes: Ticket5126 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index a5ec3c3833..c20f75a16d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2123,8 +2123,12 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
ist->hwaccel_retrieved_pix_fmt = decoded_frame->format;
best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame);
- 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);
+ if(best_effort_timestamp != AV_NOPTS_VALUE) {
+ 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) {
av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video "