[MPlayer-cvslog] r34905 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Tue May 15 23:18:40 CEST 2012


Author: reimar
Date: Tue May 15 23:18:39 2012
New Revision: 34905

Log:
Do not return void type and remove broken duplicate code.

The second copy of that code would only be run after
we already tried to use mpi pointer, which means in the
case it was supposed to handle we had already crashed.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Tue May 15 23:18:37 2012	(r34904)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Tue May 15 23:18:39 2012	(r34905)
@@ -687,8 +687,10 @@ static void release_buffer(struct AVCode
     sh_video_t *sh = avctx->opaque;
     vd_ffmpeg_ctx *ctx = sh->context;
     int i;
-    if (pic->type != FF_BUFFER_TYPE_USER)
-        return avcodec_default_release_buffer(avctx, pic);
+    if (pic->type != FF_BUFFER_TYPE_USER) {
+        avcodec_default_release_buffer(avctx, pic);
+        return;
+    }
 
 //printf("release buffer %d %d %d\n", mpi ? mpi->flags&MP_IMGFLAG_PRESERVE : -99, ctx->ip_count, ctx->b_count);
 
@@ -704,11 +706,6 @@ static void release_buffer(struct AVCode
         mpi->usage_count--;
     }
 
-    if(pic->type!=FF_BUFFER_TYPE_USER){
-        avcodec_default_release_buffer(avctx, pic);
-        return;
-    }
-
     for(i=0; i<4; i++){
         pic->data[i]= NULL;
     }


More information about the MPlayer-cvslog mailing list