[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.102,1.103

Michael Niedermayer michael at mplayerhq.hu
Wed Jul 17 02:54:37 CEST 2002


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv9624

Modified Files:
	vo_xv.c 
Log Message:
check if the available buffers are big enough in get_image


Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- vo_xv.c	16 Jul 2002 21:07:05 -0000	1.102
+++ vo_xv.c	17 Jul 2002 00:54:31 -0000	1.103
@@ -746,6 +746,9 @@
     if(mpi->type==MP_IMGTYPE_IPB && num_buffers<3 && mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // not enough
     if(mpi->type==MP_IMGTYPE_IP  && num_buffers<2 && mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // not enough
     if(mpi->imgfmt!=image_format || mpi->imgfmt==IMGFMT_BGR24) return VO_FALSE; // needs conversion :(
+    if(  xvimage[current_buf]->pitches[0]*mpi->height 
+       > xvimage[current_buf]->offsets[1] - xvimage[current_buf]->offsets[0]) return VO_FALSE; //buffer to small
+    if(  xvimage[current_buf]->pitches[0] < mpi->width /*FIXME non yv12*/) return VO_FALSE; //buffer to small
 //    if(mpi->flags&MP_IMGFLAG_READABLE) return VO_FALSE; // slow video ram
     if( (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)) ||
 	(mpi->width*(mpi->bpp/8)==xvimage[current_buf]->pitches[0]) ){




More information about the MPlayer-cvslog mailing list