Hello,

In attach,
the diff between the two previous patch, in order to add fix for b44a
compression when there is float data inside the file

Before this patch, b44a block are not detected when there is float channel
before half channel (b44a only compress half channel).

Comments welcome

Martin
Jokyo Images
From 974ec6ca2c6299a0a4054616ced6daf08d8805fa Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vign...@gmail.com>
Date: Sat, 25 Jun 2016 18:25:02 +0200
Subject: [PATCH] libavcodec/exr : fix b44a compression when there is float and
 half data.

---
 libavcodec/exr.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 05e72d8..c87187c 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -980,12 +980,19 @@ static int b44_uncompress(EXRContext *s, const uint8_t *src, int compressed_size
             }
             target_channel_offset += 2;
         } else {/* Float or UINT 32 channel */
+            if (stayToUncompress < td->ysize * td->xsize * 4) {
+                av_log(s, AV_LOG_ERROR, "Not enough data for uncompress channel: %d", stayToUncompress);
+                return AVERROR_INVALIDDATA;
+            }
+
             for (y = 0; y < td->ysize; y++) {
                 indexOut = target_channel_offset * td->xsize + y * td->channel_line_size;
                 memcpy(&td->uncompressed_data[indexOut], sr, td->xsize * 4);
                 sr += td->xsize * 4;
             }
             target_channel_offset += 4;
+
+            stayToUncompress -= td->ysize * td->xsize * 4;
         }
     }
 
-- 
1.9.3 (Apple Git-50)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to