[MPlayer-cvslog] r37796 - trunk/libmpcodecs/vd_raw.c
reimar
subversion at mplayerhq.hu
Thu Feb 25 18:09:22 CET 2016
Author: reimar
Date: Thu Feb 25 18:09:22 2016
New Revision: 37796
Log:
vd_raw: Fix < 8bpp formats.
Ensure line stride does not become 0
and export palette also for RGB/BGR4.
Modified:
trunk/libmpcodecs/vd_raw.c
Modified: trunk/libmpcodecs/vd_raw.c
==============================================================================
--- trunk/libmpcodecs/vd_raw.c Thu Feb 25 13:16:08 2016 (r37795)
+++ trunk/libmpcodecs/vd_raw.c Thu Feb 25 18:09:22 2016 (r37796)
@@ -109,10 +109,11 @@ static mp_image_t* decode(sh_video_t *sh
}
} else {
mpi->planes[0]=data;
- mpi->stride[0]=mpi->width*(mpi->bpp/8);
+ mpi->stride[0]=(mpi->width*mpi->bpp + 7)/8;
// .AVI files has uncompressed lines 4-byte aligned:
if(sh->format==0 || sh->format==3) mpi->stride[0]=(mpi->stride[0]+3)&(~3);
- if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8){
+ if(mpi->imgfmt==IMGFMT_RGB8 || mpi->imgfmt==IMGFMT_BGR8 ||
+ mpi->imgfmt==IMGFMT_RGB4 || mpi->imgfmt==IMGFMT_BGR4){
// export palette:
mpi->planes[1]=sh->bih ? (unsigned char*)(sh->bih+1) : NULL;
#if 0
More information about the MPlayer-cvslog
mailing list