diff options
author | Martin Vignali <martin.vignali@gmail.com> | 2016-04-03 14:12:44 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-04-03 17:09:29 +0200 |
commit | d2ed3391fbfe3d6806c7819f86a5aa43b89b3144 (patch) | |
tree | 4e2ba4fdc5d1aeae3d79d9bef7a0a10e5f63a07b /libavcodec/exr.c | |
parent | 4f682318fb8031f83de91a6f985db411a54ff8ff (diff) | |
download | ffmpeg-d2ed3391fbfe3d6806c7819f86a5aa43b89b3144.tar.gz |
libavcodec/exr: fix PRX24 Float decompression
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r-- | libavcodec/exr.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f6141fa09c..aaac3be403 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -778,14 +778,23 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { - unsigned long dest_len = uncompressed_size; + unsigned long dest_len, expected_len; const uint8_t *in = td->tmp; uint8_t *out; int c, i, j; - if (uncompress(td->tmp, &dest_len, src, compressed_size) != Z_OK || - dest_len != uncompressed_size) + if (s->pixel_type == EXR_FLOAT) + expected_len = (uncompressed_size / 4) * 3; /* PRX 24 store float in 24 bit instead of 32 */ + else + expected_len = uncompressed_size; + + dest_len = expected_len; + + if (uncompress(td->tmp, &dest_len, src, compressed_size) != Z_OK) { return AVERROR_INVALIDDATA; + } else if (dest_len != expected_len){ + return AVERROR_INVALIDDATA; + } out = td->uncompressed_data; for (i = 0; i < s->ysize; i++) |