changeset 24552:c9c2e550a449

MPEG-2 blocks at qp 1 get overfiltered by spp, apparently because "qp>>1" turns it into 0, which causes an integer overflow later. Clip qp at 1 to avoid this. patch by Alexander Strange, astrange ithinksw com
author diego
date Tue, 18 Sep 2007 14:08:08 +0000
parents 925b7145748d
children d6bba2781d01
files libmpcodecs/vf_spp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_spp.c	Tue Sep 18 12:08:24 2007 +0000
+++ b/libmpcodecs/vf_spp.c	Tue Sep 18 14:08:08 2007 +0000
@@ -402,7 +402,7 @@
 				qp= p->qp;
 			else{
 				qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride];
-				if(p->mpeg2) qp>>=1;
+				if(p->mpeg2) qp = FFMAX(1, qp>>1);
 			}
 			for(i=0; i<count; i++){
 				const int x1= x + offset[i+count-1][0];