mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 12:20:57 +00:00
Only call avcodec_close if the open succeeded before, otherwise avcodec_close
will crash (happens e.g. when encoding ends before any frames were actually encoded, e.g. when an MPEG file was cut down to much so it no longer contains a full video frame). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29835 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
87e2b02f7a
commit
c6b1e6880b
@ -911,6 +911,7 @@ static void uninit(struct vf_instance_s* vf){
|
|||||||
av_freep(&lavc_venc_context->intra_matrix);
|
av_freep(&lavc_venc_context->intra_matrix);
|
||||||
av_freep(&lavc_venc_context->inter_matrix);
|
av_freep(&lavc_venc_context->inter_matrix);
|
||||||
|
|
||||||
|
if (lavc_venc_context->codec)
|
||||||
avcodec_close(lavc_venc_context);
|
avcodec_close(lavc_venc_context);
|
||||||
|
|
||||||
if(stats_file) fclose(stats_file);
|
if(stats_file) fclose(stats_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user