diff mbox series

[FFmpeg-devel,v3,2/3] libavcodec/jpeg2000dec: Add check when done with main header markers

Message ID 20200721180715.19237-2-gautamramk@gmail.com
State Accepted
Commit b61d3dfab0d75daf81f366c12c57539c90e9b38b
Headers show
Series [FFmpeg-devel,v3,1/3] libavcodec/jpeg2000dec: Fix codeblock decode check
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Gautam Ramakrishnan July 21, 2020, 6:07 p.m. UTC
From: Gautam Ramakrishnan <gautamramk@gmail.com>

This patch sets a flag when the processing of the
main header is complete.
---
 libavcodec/jpeg2000dec.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer July 23, 2020, 2:30 p.m. UTC | #1
On Tue, Jul 21, 2020 at 11:37:14PM +0530, gautamramk@gmail.com wrote:
> From: Gautam Ramakrishnan <gautamramk@gmail.com>
> 
> This patch sets a flag when the processing of the
> main header is complete.
> ---
>  libavcodec/jpeg2000dec.c | 4 ++++
>  1 file changed, 4 insertions(+)

will apply

thx

[...]
Paul B Mahol July 23, 2020, 2:32 p.m. UTC | #2
On 7/23/20, Michael Niedermayer <michael@niedermayer.cc> wrote:
> On Tue, Jul 21, 2020 at 11:37:14PM +0530, gautamramk@gmail.com wrote:
>> From: Gautam Ramakrishnan <gautamramk@gmail.com>
>>
>> This patch sets a flag when the processing of the
>> main header is complete.
>> ---
>>  libavcodec/jpeg2000dec.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>
> will apply
>
> thx
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Elect your leaders based on what they did after the last election, not
> based on what they say before an election.

Well said. But ffmpeg always picks/have same leaders.
diff mbox series

Patch

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 5e9e97eb6a..23792c15b2 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -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;