changeset 10334:71cf44ecaa70 libavcodec

Make MS RLE decoder produce both bottom-up and top-down pictures
author kostya
date Thu, 01 Oct 2009 05:42:55 +0000
parents c1c4435539e6
children 3b0a2384ff9f
files msrledec.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/msrledec.c	Thu Oct 01 00:06:54 2009 +0000
+++ b/msrledec.c	Thu Oct 01 05:42:55 2009 +0000
@@ -167,7 +167,8 @@
                 continue;
             }
             // Copy data
-            if (output + p2 * (depth >> 3) > output_end) {
+            if ((pic->linesize[0] > 0 && output + p2 * (depth >> 3) > output_end)
+              ||(pic->linesize[0] < 0 && output + p2 * (depth >> 3) < output_end)) {
                 src += p2 * (depth >> 3);
                 continue;
             }
@@ -211,7 +212,8 @@
                      src += 4;
                      break;
             }
-            if (output + p1 * (depth >> 3) > output_end)
+            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){