diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-30 16:33:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-14 04:57:36 +0100 |
commit | e586e4d93bfb66ccfcfa9c2aa48649f85470b6a1 (patch) | |
tree | 03da5d46df332d081697c812ac78a61783edfdf0 /libavcodec/msrledec.c | |
parent | f156dc54f8c285ec2f11cd9cc7e2e0d7c510cb04 (diff) | |
download | ffmpeg-e586e4d93bfb66ccfcfa9c2aa48649f85470b6a1.tar.gz |
msrledec: move output pointer test up
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2992b705381e082e33633e62e151887da67b285)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msrledec.c')
-rw-r--r-- | libavcodec/msrledec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c index 03e8a1b20b..44371f0a1f 100644 --- a/libavcodec/msrledec.c +++ b/libavcodec/msrledec.c @@ -203,6 +203,9 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, pos += p2; } else { //run of pixels 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){ case 8: pix[0] = bytestream2_get_byte(gb); break; @@ -215,9 +218,6 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, case 32: pix32 = bytestream2_get_le32(gb); 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++) { switch(depth){ case 8: *output++ = pix[0]; |