summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-15 21:02:22 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-15 21:02:22 +0000
commita3d81b74f97c354e3b9b0842c5e17dab46eb55ca (patch)
tree6e482b108740febc54b1af9338d5d43fd86fd618 /libmpcodecs
parenteafdad4b73beef6e9d5595164e9584d4ecccc525 (diff)
downloadmpv-a3d81b74f97c354e3b9b0842c5e17dab46eb55ca.tar.bz2
mpv-a3d81b74f97c354e3b9b0842c5e17dab46eb55ca.tar.xz
This patch fixes a segfault for native cvid decoder in bgr32 and bgr24 modes.
Roberto Togni <rtogni@bresciaonline.it> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7410 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/native/cinepak.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libmpcodecs/native/cinepak.c b/libmpcodecs/native/cinepak.c
index b29d78cbb5..23cce4c21b 100644
--- a/libmpcodecs/native/cinepak.c
+++ b/libmpcodecs/native/cinepak.c
@@ -352,7 +352,7 @@ int uvr, uvg, uvb;
/* ------------------------------------------------------------------------ */
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 @@ unsigned long rgb;
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 @@ int uvr, uvg, uvb;
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 @@ unsigned char *vptr = mpi->planes[0] + (y * mpi->stride[0] + x) * 3;
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