avformat/jpegxl_anim_dec: Perform operations in a different order

Fixes: OOM
Fixes: 59802/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5681765466112000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-06-18 23:50:16 +02:00 committed by Leo Izen
parent 61047f0f82
commit 9fc141f32d
No known key found for this signature in database
GPG Key ID: 5A71C331FD2FA19A
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ static int jpegxl_anim_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ctx->initial && size < ctx->initial->size)
size = ctx->initial->size;
if ((ret = av_new_packet(pkt, size) < 0))
if ((ret = av_new_packet(pkt, size)) < 0)
return ret;
if (ctx->initial) {