Fix M$RLE 4bit. Patch by Michael Guennewig <michaelguennewig(at)gmx(dot)de>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10452 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtognimp 2003-07-21 19:04:12 +00:00
parent a50a1eab17
commit 5f26ad53e4
1 changed files with 4 additions and 3 deletions

View File

@ -137,10 +137,9 @@ void decode_msrle4(
else else
{ {
// copy pixels from encoded stream // copy pixels from encoded stream
rle_code = stream_byte; rle_code = ((stream_byte + 1) & (~1)) / 2;
rle_code /= 2;
extra_byte = rle_code & 0x01; 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)) (row_ptr < 0))
{ {
mp_msg(MSGT_DECVIDEO, MSGL_WARN, mp_msg(MSGT_DECVIDEO, MSGL_WARN,
@ -170,6 +169,8 @@ void decode_msrle4(
} }
pixel_ptr += bytes_per_pixel; pixel_ptr += bytes_per_pixel;
if (i + 1 == rle_code && (stream_byte & 1) != 0)
break;
if (pixel_ptr >= row_dec) if (pixel_ptr >= row_dec)
break; break;
if (bytes_per_pixel == 2) if (bytes_per_pixel == 2)