Re: [FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: fix various memory issues

2023-10-02 Thread Andreas Rheinhardt
Leo Izen: > On 10/2/23 16:40, Andreas Rheinhardt wrote: >> Leo Izen: >>> The spec caps the prefix alphabet size to 32768 (i.e. 1 << 15) so we >>> need to check for that and reject alphabets that are too large. >> >> No, we don't "need to", we can. FFmpeg is not a validator tool. > > We need to bec

Re: [FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: fix various memory issues

2023-10-02 Thread Leo Izen
On 10/2/23 16:40, Andreas Rheinhardt wrote: Leo Izen: The spec caps the prefix alphabet size to 32768 (i.e. 1 << 15) so we need to check for that and reject alphabets that are too large. No, we don't "need to", we can. FFmpeg is not a validator tool. We need to because we risk over-allocatin

Re: [FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: fix various memory issues

2023-10-02 Thread Andreas Rheinhardt
Leo Izen: > The spec caps the prefix alphabet size to 32768 (i.e. 1 << 15) so we > need to check for that and reject alphabets that are too large. No, we don't "need to", we can. FFmpeg is not a validator tool. > > Additionally, there's no need to allocate buffers that are as large as > the maxi

[FFmpeg-devel] [PATCH] avcodec/jpegxl_parser: fix various memory issues

2023-10-02 Thread Leo Izen
The spec caps the prefix alphabet size to 32768 (i.e. 1 << 15) so we need to check for that and reject alphabets that are too large. Additionally, there's no need to allocate buffers that are as large as the maximum alphabet size as these aren't stack-allocated, they're heap allocated and thus can