From 951e715cebfaffced7f13c1525771ff917fe1d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 6 Apr 2012 13:51:34 +0300 Subject: [PATCH] avplay: Don't try to scale timestamps if the tb isn't set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If get_filtered_video_frame failed above, tb might not be initialized at all, so don't scale using it. This fixes cases where avplay could crash if aborting avformat_find_stream_info with ctrl+c. Signed-off-by: Martin Storsjö --- avplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avplay.c b/avplay.c index d9c178604f..d1cf53d117 100644 --- a/avplay.c +++ b/avplay.c @@ -1796,7 +1796,7 @@ static int video_thread(void *arg) frame->opaque = picref; } - if (av_cmp_q(tb, is->video_st->time_base)) { + if (ret >= 0 && av_cmp_q(tb, is->video_st->time_base)) { av_unused int64_t pts1 = pts_int; pts_int = av_rescale_q(pts_int, tb, is->video_st->time_base); av_dlog(NULL, "video_thread(): "