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>
pull/389/head
Michael Niedermayer 2 years ago committed by Leo Izen
parent 61047f0f82
commit 9fc141f32d
No known key found for this signature in database
GPG Key ID: 5A71C331FD2FA19A
  1. 2
      libavformat/jpegxl_anim_dec.c

@ -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) {

Loading…
Cancel
Save