[Mplayer-cvslog] CVS: main/libmpcodecs/native cinepak.c,1.11,1.12

Arpi of Ize arpi at mplayerhq.hu
Sun Sep 15 23:02:25 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs/native
In directory mail:/var/tmp.root/cvs-serv2049

Modified Files:
	cinepak.c 
Log Message:
This patch fixes a segfault for native cvid decoder in bgr32 and bgr24 modes.
Roberto Togni <rtogni at bresciaonline.it>


Index: cinepak.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/native/cinepak.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cinepak.c	13 Apr 2002 19:14:32 -0000	1.11
+++ cinepak.c	15 Sep 2002 21:02:22 -0000	1.12
@@ -352,7 +352,7 @@
 /* ------------------------------------------------------------------------ */
 inline void cvid_v1_32(mp_image_t *mpi, unsigned int x, unsigned int y, cvid_codebook *cb)
 {
-int stride = mpi->stride[0];
+int stride = mpi->stride[0]/4;
 unsigned long *vptr = (unsigned long *)mpi->planes[0];
 unsigned long rgb;
 
@@ -378,7 +378,7 @@
 inline void cvid_v4_32(mp_image_t *mpi, unsigned int x, unsigned int y, cvid_codebook *cb0,
 	cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
 {
-int stride = mpi->stride[0];
+int stride = mpi->stride[0]/4;
 unsigned long *vptr = (unsigned long *)mpi->planes[0];
 
 	if(y+3>=(unsigned int)mpi->height) return; // avoid sig11
@@ -450,8 +450,8 @@
 inline void cvid_v1_24(mp_image_t *mpi, unsigned int x, unsigned int y, cvid_codebook *cb)
 {
 unsigned char r, g, b;
-int stride = (mpi->stride[0]-4)*3;
-unsigned char *vptr = mpi->planes[0] + (y * mpi->stride[0] + x) * 3;
+int stride = (mpi->stride[0])-4*3;
+unsigned char *vptr = mpi->planes[0] + (y * mpi->stride[0]) + x * 3;
 
 	if(y+3>=(unsigned int)mpi->height) return; // avoid sig11
 
@@ -481,8 +481,8 @@
 inline void cvid_v4_24(mp_image_t *mpi, unsigned int x, unsigned int y, cvid_codebook *cb0,
 	cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
 {
-int stride = (mpi->stride[0]-4)*3;
-unsigned char *vptr = mpi->planes[0] + (y * mpi->stride[0] + x) * 3;
+int stride = (mpi->stride[0])-4*3;
+unsigned char *vptr = mpi->planes[0] + (y * mpi->stride[0]) + x * 3;
 
 	if(y+3>=(unsigned int)mpi->height) return; // avoid sig11
 




More information about the MPlayer-cvslog mailing list