From: Anthony Minessale Date: Mon, 15 May 2017 22:28:04 +0000 (-0500) Subject: FS-10320: [mod_av] Playing a file with audio only with mod_av can crash when attempti... X-Git-Tag: v1.8.0~513 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69b723b12dbc505a9563ae52deb3a9934f95d74e;p=thirdparty%2Ffreeswitch.git FS-10320: [mod_av] Playing a file with audio only with mod_av can crash when attempting to seek #resolve --- diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index a724a86687..efadc87708 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -1531,10 +1531,12 @@ static void *SWITCH_THREAD_FUNC file_read_thread_run(switch_thread_t *thread, vo switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "seeking to %" SWITCH_INT64_T_FMT "\n", context->seek_ts); avformat_seek_file(context->fc, stream_id, 0, context->seek_ts, INT64_MAX, 0); context->seek_ts = -2; - context->video_st.next_pts = 0; - context->video_start_time = 0; - avcodec_flush_buffers(context->video_st.st->codec); + if (context->has_video) { + context->video_st.next_pts = 0; + context->video_start_time = 0; + avcodec_flush_buffers(context->video_st.st->codec); + } } if (context->has_video) {