[SCM] libav/experimental: tiffdec: use a single strip if RowsPerStrip is 0

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:02:48 UTC 2014


The following commit has been merged in the experimental branch:
commit fdbe18b7b0545f9b5923d25a5433e4f735719ecc
Author: Justin Ruggles <justin.ruggles at gmail.com>
Date:   Mon Sep 30 00:11:12 2013 -0400

    tiffdec: use a single strip if RowsPerStrip is 0
    
    The spec does not specify that 0 is an error condition, and there
    are samples which use 0 when the whole image is in one strip.

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 0cfa4c4..e7f1866 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -418,14 +418,9 @@ static int tiff_decode_tag(TiffContext *s)
         }
         break;
     case TIFF_ROWSPERSTRIP:
-        if (type == TIFF_LONG && value == UINT_MAX)
-            value = s->avctx->height;
-        if (value < 1) {
-            av_log(s->avctx, AV_LOG_ERROR,
-                   "Incorrect value of rows per strip\n");
-            return AVERROR_INVALIDDATA;
-        }
-        s->rps = value;
+        if (!value || (type == TIFF_LONG && value == UINT_MAX))
+            value = s->height;
+        s->rps = FFMIN(value, s->height);
         break;
     case TIFF_STRIP_OFFS:
         if (count == 1) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list