# HG changeset patch # User reimar # Date 1337116719 0 # Node ID 326242b21831c362e9a60def04e7721d9de4bebe # Parent 0640d4451aa7fcd34d2892cc877afd20dc081b13 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. diff -r 0640d4451aa7 -r 326242b21831 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Tue May 15 21:18:37 2012 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Tue May 15 21:18:39 2012 +0000 @@ -687,8 +687,10 @@ 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 @@ 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; }