Fix T52739: Crash loading corrupted video files

Affects both "normal" open as a video file and thumbnail generation.
This commit is contained in:
2017-09-14 14:55:35 +05:00
parent c57636f060
commit 8140b51aa4

View File

@@ -513,6 +513,11 @@ static int startffmpeg(struct anim *anim)
avformat_close_input(&pFormatCtx);
return -1;
}
if (pCodecCtx->pix_fmt == AV_PIX_FMT_NONE) {
avcodec_close(anim->pCodecCtx);
avformat_close_input(&pFormatCtx);
return -1;
}
frame_rate = av_get_r_frame_rate_compat(pFormatCtx->streams[videoStream]);
if (pFormatCtx->streams[videoStream]->nb_frames != 0) {