Commit c2992b70 authored by Michael Niedermayer's avatar Michael Niedermayer

msrledec: move output pointer test up

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d8a7c495
...@@ -203,6 +203,9 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, ...@@ -203,6 +203,9 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
pos += p2; pos += p2;
} else { //run of pixels } else { //run of pixels
uint8_t pix[3]; //original pixel uint8_t pix[3]; //original pixel
if ((pic->linesize[0] > 0 && output + p1 * (depth >> 3) > output_end) ||
(pic->linesize[0] < 0 && output + p1 * (depth >> 3) < output_end))
continue;
switch(depth){ switch(depth){
case 8: pix[0] = bytestream2_get_byte(gb); case 8: pix[0] = bytestream2_get_byte(gb);
break; break;
...@@ -215,9 +218,6 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, ...@@ -215,9 +218,6 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
case 32: pix32 = bytestream2_get_le32(gb); case 32: pix32 = bytestream2_get_le32(gb);
break; break;
} }
if ((pic->linesize[0] > 0 && output + p1 * (depth >> 3) > output_end) ||
(pic->linesize[0] < 0 && output + p1 * (depth >> 3) < output_end))
continue;
for(i = 0; i < p1; i++) { for(i = 0; i < p1; i++) {
switch(depth){ switch(depth){
case 8: *output++ = pix[0]; case 8: *output++ = pix[0];
......
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