]> git.sesse.net Git - ffmpeg/commitdiff
libavcodec/jpeg2000dec: Add check when done with main header markers
authorGautam Ramakrishnan <gautamramk@gmail.com>
Tue, 21 Jul 2020 18:07:14 +0000 (23:37 +0530)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 23 Jul 2020 14:30:02 +0000 (16:30 +0200)
This patch sets a flag when the processing of the
main header is complete.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/jpeg2000dec.c

index f5ad8402fbc4b3a74a9e9c3ac47e327fc55bffd3..e941ebb5d0708fb20157378b3d2383f1484d5728 100644 (file)
@@ -102,6 +102,7 @@ typedef struct Jpeg2000DecoderContext {
     uint8_t         cbps[4];    // bits per sample in particular components
     uint8_t         sgnd[4];    // if a component is signed
     uint8_t         properties[4];
+    uint8_t         in_tile_headers;
     int             cdx[4], cdy[4];
     int             precision;
     int             ncomponents;
@@ -2165,6 +2166,9 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
             ret = get_poc(s, len, poc);
             break;
         case JPEG2000_SOT:
+            if (!s->in_tile_headers) {
+                s->in_tile_headers = 1;
+            }
             if (!(ret = get_sot(s, len))) {
                 av_assert1(s->curtileno >= 0);
                 codsty = s->tile[s->curtileno].codsty;