[FFmpeg-devel] [PATCH] avcodec/jpeg2000dec: clear array length when freeing it

Michael Niedermayer michael at niedermayer.cc
Sun Jan 5 20:26:14 EET 2025


Hi

On Wed, Jan 01, 2025 at 11:58:39PM -0300, James Almer wrote:
> Fixes NULL pointer dereferences.
> Fixes ticket #11393.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/jpeg2000dec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> index 84eebfd1b2..352860f4c0 100644
> --- a/libavcodec/jpeg2000dec.c
> +++ b/libavcodec/jpeg2000dec.c
> @@ -1517,6 +1517,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
>                  }
>              }
>              av_freep(&cblk->lengthinc);
> +            cblk->nb_lengthinc = 0;
>          }
>      }
>      // Save state of stream

that looks correct

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The difference between a dictatorship and a democracy is that every 4 years
the population together is allowed to provide 1 bit of input to the government.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250105/c8987d93/attachment.sig>


More information about the ffmpeg-devel mailing list