Commit Graph

6 Commits

Author SHA1 Message Date
Michael Niedermayer d2e8974699
avformat/jpegxl_anim_dec: Check that size fits within argument
Fixes: out of array access
Fixes: 61991/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5524679648215040
Fixes: 62181/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5504964305485824
Fixes: 62214/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-4782972823535616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-09-14 22:00:17 +02:00
Leo Izen e8a63b4763
avformat/jpegxl: remove jpegxl_probe, instead call avcodec/jpegxl_parse
This prevents code duplication in the source form by calling the parse
code that was moved to avcodec last commit. The code will be duplicated
in binary form for shared builds (it's not that large), but for source
code it will only exist in one location now.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-27 01:36:18 -04:00
Michael Niedermayer 6a9d13acc2
avformat/jpegxl_anim_dec: fix out of array read using buffer padding
Fixes: out of array read
Fixes: 59828/clusterfuzz-testcase-minimized-ffmpeg_dem_JPEGXL_ANIM_fuzzer-5029813220671488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-20 12:47:31 -04:00
Michael Niedermayer 9fc141f32d
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>
2023-06-18 17:54:19 -04:00
Leo Izen 61047f0f82
avformat/jpegxl_anim_dec: avoid overrun with jxlp boxes in container
This switches the jpegxl_collect_codestream_header function to use
avcodec/bytestream2, which better enforces barriers, and should avoid
overrunning buffers with jxlp boxes if the size is zero or if the size
is so small the box is invalid.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-06-18 10:31:05 -04:00
Leo Izen fa11c4c7fa
avformat/jpegxl_anim_dec: add animated JPEG XL demuxer
Animated JPEG XL files requires a separate demuxer than image2, because
the timebase information is set by the demuxer. Should the timebase of
an animated JPEG XL file be incompatible with the timebase set by the
image2pipe demuxer (usually 1/25 unless set otherwise), rescaling will
fail. Adding a separate demuxer for animated JPEG XL files allows the
timebase to be set correctly.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-06-05 12:15:05 -04:00