Fix T52739: Crash loading corrupted video files
Affects both "normal" open as a video file and thumbnail generation.
This commit is contained in:
parent
c57636f060
commit
8140b51aa4
Notes:
blender-bot
2023-02-14 06:54:28 +01:00
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue