On 2013-06-23 08:50, Luca Barbato wrote:
There are 32 maximum decomposition levels, thus 33 resolution levels.
---
  libavcodec/jpeg2000dec.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

This appears to require 02/71.

--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -251,7 +251,11 @@ static int get_cox(Jpeg2000DecoderContext *s, 
Jpeg2000CodingStyle *c)

      if (s->buf_end - s->buf < 5)
          return AVERROR(EINVAL);
-    c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution 
levels - 1
+    // num of resolution levels - 1
+    c->nreslevels = bytestream_get_byte(&s->buf) + 1;

Maybe make it "number of" as below while you're at it.

+    if (c->nreslevels > JPEG2000_MAX_RESLEVELS)
+        return AVERROR_INVALIDDATA;

      /* compute number of resolution levels to decode */
      if (c->nreslevels < s->reduction_factor)

probably OK otherwise

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to