summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-28 02:03:11 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-28 02:06:02 +0100
commit85ab9deb9808add099e8564b80244698e5649852 (patch)
tree4ae7bc4c7fbb5dfedc5799f1ae4efb3f322034fb /libavcodec
parentbc04ea39a57a22dd4d26946a83e166f090218054 (diff)
avcodec/exr: handle case when |im - IM| == 1 for huff compression
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/exr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 5f99d9d5ab..4559174ba2 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -420,6 +420,11 @@ static int huf_build_dec_table(EXRContext *s,
td->run_sym = i;
}
+ if (im > 0)
+ td->run_sym = 0;
+ else if (iM < 65535)
+ td->run_sym = 65535;
+
if (td->run_sym == -1) {
avpriv_request_sample(s->avctx, "No place for run symbol");
return AVERROR_PATCHWELCOME;