[MPlayer-cvslog] r37904 - trunk/libmpcodecs/vf_bmovl.c

al subversion at mplayerhq.hu
Sun Oct 30 03:55:45 EET 2016


Author: al
Date: Sun Oct 30 03:55:45 2016
New Revision: 37904

Log:
vf_bmovl: Use picture sizes instead of buffer sizes

Buffer sizes may include padding which is not guaranteed to match
in different mp images.

Using buffer sizes in memcpy_pic can lead to image corruptions,
buffer overflows and therefore at least crashes.

Fixes trac ticket #2308

Modified:
   trunk/libmpcodecs/vf_bmovl.c

Modified: trunk/libmpcodecs/vf_bmovl.c
==============================================================================
--- trunk/libmpcodecs/vf_bmovl.c	Sat Oct 22 02:13:02 2016	(r37903)
+++ trunk/libmpcodecs/vf_bmovl.c	Sun Oct 30 03:55:45 2016	(r37904)
@@ -229,9 +229,9 @@ put_image(struct vf_instance *vf, mp_ima
 						MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
 						mpi->w, mpi->h);
 
-    memcpy_pic( dmpi->planes[0], mpi->planes[0], mpi->width, mpi->height, dmpi->stride[0], mpi->stride[0] );
-    memcpy_pic( dmpi->planes[1], mpi->planes[1], mpi->chroma_width, mpi->chroma_height, dmpi->stride[1], mpi->stride[1] );
-    memcpy_pic( dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height, dmpi->stride[2], mpi->stride[2] );
+    memcpy_pic( dmpi->planes[0], mpi->planes[0], mpi->w,   mpi->h,   dmpi->stride[0], mpi->stride[0] );
+    memcpy_pic( dmpi->planes[1], mpi->planes[1], mpi->w/2, mpi->h/2, dmpi->stride[1], mpi->stride[1] );
+    memcpy_pic( dmpi->planes[2], mpi->planes[2], mpi->w/2, mpi->h/2, dmpi->stride[2], mpi->stride[2] );
 
     if(vf->priv->stream_fd >= 0) {
 		struct timeval tv;


More information about the MPlayer-cvslog mailing list