]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/exr: add missed hunks from previous exr commit
authorMartin Vignali <martin.vignali@gmail.com>
Sat, 25 Jun 2016 16:24:12 +0000 (18:24 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sat, 25 Jun 2016 16:28:06 +0000 (18:28 +0200)
libavcodec/exr.c

index 05e72d844066d26326994c0d9a21c6e6a53e2e5e..c87187c05ca97bd7e85d538ea45498bb38b12bca 100644 (file)
@@ -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;
         }
     }