mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-22 10:58:04 +00:00
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" Originally committed as revision 16013 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
ce60c2d133
commit
6149cdbe9d
@ -195,13 +195,12 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
|
|||||||
}
|
}
|
||||||
pos += p2;
|
pos += p2;
|
||||||
} else { //Run of pixels
|
} else { //Run of pixels
|
||||||
int pix[4]; //original pixel
|
uint8_t pix[3]; //original pixel
|
||||||
switch(depth){
|
switch(depth){
|
||||||
case 8: pix[0] = *src++;
|
case 8: pix[0] = *src++;
|
||||||
break;
|
break;
|
||||||
case 16: pix16 = AV_RL16(src);
|
case 16: pix16 = AV_RL16(src);
|
||||||
src += 2;
|
src += 2;
|
||||||
*(uint16_t*)pix = pix16;
|
|
||||||
break;
|
break;
|
||||||
case 24: pix[0] = *src++;
|
case 24: pix[0] = *src++;
|
||||||
pix[1] = *src++;
|
pix[1] = *src++;
|
||||||
@ -209,7 +208,6 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
|
|||||||
break;
|
break;
|
||||||
case 32: pix32 = AV_RL32(src);
|
case 32: pix32 = AV_RL32(src);
|
||||||
src += 4;
|
src += 4;
|
||||||
*(uint32_t*)pix = pix32;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (output + p1 * (depth >> 3) > output_end)
|
if (output + p1 * (depth >> 3) > output_end)
|
||||||
|
Loading…
Reference in New Issue
Block a user