[Mplayer-cvslog] CVS: main/libmpcodecs vd_msrle.c,1.4,1.5

Roberto Togni CVS rtognimp at mplayerhq.hu
Mon Jul 21 21:04:32 CEST 2003


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

Modified Files:
	vd_msrle.c 
Log Message:
Fix M$RLE 4bit. Patch by Michael Guennewig <michaelguennewig(at)gmx(dot)de>


Index: vd_msrle.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_msrle.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vd_msrle.c	30 Aug 2002 21:44:20 -0000	1.4
+++ vd_msrle.c	21 Jul 2003 19:04:12 -0000	1.5
@@ -137,10 +137,9 @@
       else
       {
         // copy pixels from encoded stream
-        rle_code = stream_byte;
-        rle_code /= 2;
+        rle_code = ((stream_byte + 1) & (~1)) / 2;
         extra_byte = rle_code & 0x01;
-        if ((row_ptr + pixel_ptr + rle_code * bytes_per_pixel > frame_size) ||
+        if ((row_ptr + pixel_ptr + stream_byte * bytes_per_pixel > frame_size) ||
             (row_ptr < 0))
         {
           mp_msg(MSGT_DECVIDEO, MSGL_WARN,
@@ -170,6 +169,8 @@
           }
           pixel_ptr += bytes_per_pixel;
 
+	  if (i + 1 == rle_code && (stream_byte & 1) != 0)
+	    break;
           if (pixel_ptr >= row_dec)
             break;
           if (bytes_per_pixel == 2)



More information about the MPlayer-cvslog mailing list