[MPlayer-cvslog] r37802 - in trunk/libmpcodecs: vd_ffmpeg.c vf.c
reimar
subversion at mplayerhq.hu
Thu Feb 25 23:39:17 CET 2016
Author: reimar
Date: Thu Feb 25 23:39:17 2016
New Revision: 37802
Log:
mp_image: ensure unused pointers are cleared out.
Fixes the MPlayer side of issue #2262, though I believe
there is still a FFmpeg bug.
Modified:
trunk/libmpcodecs/vd_ffmpeg.c
trunk/libmpcodecs/vf.c
Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c Thu Feb 25 22:34:45 2016 (r37801)
+++ trunk/libmpcodecs/vd_ffmpeg.c Thu Feb 25 23:39:17 2016 (r37802)
@@ -719,6 +719,12 @@ static int get_buffer(AVCodecContext *av
mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type== MP_IMGTYPE_IPB ? "using IPB\n" : "using IP\n");
}
+ // Make sure to not leak dead pointers.
+ pic->data[0]= NULL;
+ pic->data[1]= NULL;
+ pic->data[2]= NULL;
+ pic->data[3]= NULL;
+
if (ctx->best_csp == IMGFMT_RGB8 || ctx->best_csp == IMGFMT_BGR8)
flags |= MP_IMGFLAG_RGB_PALETTE;
mpi= mpcodecs_get_image(sh, type, flags, width, height);
Modified: trunk/libmpcodecs/vf.c
==============================================================================
--- trunk/libmpcodecs/vf.c Thu Feb 25 22:34:45 2016 (r37801)
+++ trunk/libmpcodecs/vf.c Thu Feb 25 23:39:17 2016 (r37802)
@@ -372,6 +372,9 @@ mp_image_t* vf_get_image(vf_instance_t*
av_freep(&mpi->planes[0]);
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
av_freep(&mpi->planes[1]);
+ mpi->planes[1] = NULL;
+ mpi->planes[2] = NULL;
+ mpi->planes[3] = NULL;
mpi->flags&=~MP_IMGFLAG_ALLOCATED;
mpi->bpp = 0;
mp_msg(MSGT_VFILTER,MSGL_V,"vf.c: have to REALLOCATE buffer memory in vf_%s :(\n",
More information about the MPlayer-cvslog
mailing list