changeset 10250:2bf4914e2253

fixed mem corruption bugs
author arpi
date Fri, 06 Jun 2003 19:12:08 +0000
parents 26564090989b
children 95dc2037fb27
files libmpcodecs/vd_libmpeg2.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_libmpeg2.c	Thu Jun 05 23:16:33 2003 +0000
+++ b/libmpcodecs/vd_libmpeg2.c	Fri Jun 06 19:12:08 2003 +0000
@@ -137,15 +137,15 @@
 		    (info->current_picture->flags&PIC_FLAG_PROGRESSIVE_FRAME)) ?
 			    MP_IMGFLAG_DRAW_CALLBACK:0)
 		: (MP_IMGFLAG_PRESERVE|MP_IMGFLAG_READABLE),
-		(info->sequence->picture_width+7)&(~7),
-		(info->sequence->picture_height+7)&(~7) );
+		(info->sequence->picture_width+15)&(~15),
+		(info->sequence->picture_height+15)&(~15) );
 	    if(!mpi) return 0; // VO ERROR!!!!!!!!
 	    mpeg2_set_buf(mpeg2dec, mpi->planes, mpi);
 
 #ifdef MPEG12_POSTPROC
 	    if(!mpi->qscale){
-		mpi->qstride=info->sequence->picture_width>>4;
-		mpi->qscale=malloc(mpi->qstride*(info->sequence->picture_height>>4));
+		mpi->qstride=(info->sequence->picture_width+15)>>4;
+		mpi->qscale=malloc(mpi->qstride*((info->sequence->picture_height+15)>>4));
 	    }
 	    mpeg2dec->decoder.quant_store=mpi->qscale;
 	    mpeg2dec->decoder.quant_stride=mpi->qstride;