[FFmpeg-cvslog] msrledec: move output pointer test up

Michael Niedermayer git at videolan.org
Wed Mar 20 21:02:57 CET 2013


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 30 16:33:45 2013 +0100| [10d59d29bc931ae9849611fdb17af8b12a692eab] | committer: Michael Niedermayer

msrledec: move output pointer test up

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c2992b705381e082e33633e62e151887da67b285)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10d59d29bc931ae9849611fdb17af8b12a692eab
---

 libavcodec/msrledec.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
index 36a46b5..6596cec 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];



More information about the ffmpeg-cvslog mailing list