[MPlayer-cvslog] r29835 - trunk/libmpcodecs/ve_lavc.c

reimar subversion at mplayerhq.hu
Fri Nov 6 16:45:55 CET 2009


Author: reimar
Date: Fri Nov  6 16:45:55 2009
New Revision: 29835

Log:
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).

Modified:
   trunk/libmpcodecs/ve_lavc.c

Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c	Fri Nov  6 15:06:58 2009	(r29834)
+++ trunk/libmpcodecs/ve_lavc.c	Fri Nov  6 16:45:55 2009	(r29835)
@@ -911,7 +911,8 @@ static void uninit(struct vf_instance_s*
     av_freep(&lavc_venc_context->intra_matrix);
     av_freep(&lavc_venc_context->inter_matrix);
 
-    avcodec_close(lavc_venc_context);
+    if (lavc_venc_context->codec)
+        avcodec_close(lavc_venc_context);
 
     if(stats_file) fclose(stats_file);
 


More information about the MPlayer-cvslog mailing list