Commit d1f4073b authored by kostya's avatar kostya

Make decoding run of pixels in MS RLE saner.

This is based on patches by Alex Converse and Mans Rullgard
Thread "[PATCH] Fix MSRLE type punning"


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16013 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 08f71f5a
......@@ -195,13 +195,12 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
}
pos += p2;
} else { //Run of pixels
int pix[4]; //original pixel
uint8_t pix[3]; //original pixel
switch(depth){
case 8: pix[0] = *src++;
break;
case 16: pix16 = AV_RL16(src);
src += 2;
*(uint16_t*)pix = pix16;
break;
case 24: pix[0] = *src++;
pix[1] = *src++;
......@@ -209,7 +208,6 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
break;
case 32: pix32 = AV_RL32(src);
src += 4;
*(uint32_t*)pix = pix32;
break;
}
if (output + p1 * (depth >> 3) > output_end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment