diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-09-14 12:55:35 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-09-14 12:56:25 +0300 |
commit | 8140b51aa45427bd951646775f6c3221271f35d2 (patch) | |
tree | 6da59804fd5c049c690de19c3ef66d0857cc036c /source/blender/imbuf | |
parent | c57636f06001880022a4a091d20615ba527f2389 (diff) |
Fix T52739: Crash loading corrupted video files
Affects both "normal" open as a video file and thumbnail generation.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 9806ff006d7..5bb91efe186 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -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) { |