1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Michael Niedermayer
ac4e3e188a
avcodec/evc_parse: Check num_remaining_tiles_in_slice_minus1
Fixes: out of array access
Fixes: 62467/clusterfuzz-testcase-minimized-ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-6092990982258688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: "Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics" <d.kozinski@samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-11-10 00:15:28 +01:00
Michael Niedermayer
68cc1744db
avcodec/evc_parse: Check tid
The check is based on not infinite looping. It is likely
a more strict check can be done

Fixes: Infinite loop
Fixes: 62473/clusterfuzz-testcase-minimized-ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-5719883750703104
Fixes: 62765/clusterfuzz-testcase-minimized-ffmpeg_dem_EVC_fuzzer-6448531252314112
Fixes: 63378/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGPS_fuzzer-6504993844494336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: "Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics" <d.kozinski@samsung.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-11-01 16:40:19 +01:00
Michael Niedermayer
d35eecd24f
avcodec/evc_parse: remove pow() and log2()
The use of float based functions is both unneeded and wrong due to unpredictable rounding

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-11-01 16:40:03 +01:00
Andreas Rheinhardt
6e5e74c55b avcodec/evc*: Improve included headers
In particular, don't include avcodec.h in evc_frame_merge_bsf.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-24 10:37:07 +02:00
James Almer
5b966be5b8 avcodec/evc_parse: use unsigned types in structs where corresponds
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
1bcb8a7338 avcodec/evc_parser: use a GetBitContext to parse entire NALUs
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
e5da2ec456 avcodec/evc_parse: pass a GetBitContext to the slice header parsing function
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer
7ff3dce29a avcodec/evc_parse: use get_bits1() where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 19:43:17 -03:00
James Almer
5cb9ef9300 avcodec/evc_parse: remove ff_evc_parse_nal_unit()
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
James Almer
a5663f2d9a avcodec/evc_parser: make ff_evc_parse_nal_unit() local to the parser
This is in preparation for the following commits.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
James Almer
ff7a4cdf04 avcodec/evc_parse: split off deriving PoC
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
James Almer
f7e0af5edc avcodec/evc_parser: stop exporting delay and gop_size
The former is a property a decoder may export, and the latter is only
used in encoding scenarios.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
James Almer
1e189fed7a avcodec/evc_parse: split off Parameter Set parsing into its own file
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-19 12:57:31 -03:00
James Almer
9fc1d9adc8 avcodec/evc_parse: make freeing EVCParserContext buffers a shared function
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:54 -03:00
James Almer
46a9be01b8 avcodec/evc_parse: free pps struct on parsing failure
Prevents future checks for their presence from succeeding.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:54 -03:00
James Almer
811460f5c2 avcodec/evc_parse: use the correct sps when parsing slice headers
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:54 -03:00
James Almer
44f26315c8 avcodec/evc_parse: use a local EVCParserSliceHeader when parsing slices
There's no need to store EVC_MAX_PPS_COUNT amount of slice headers in EVCParserContext.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:54 -03:00
James Almer
57879b23bc avcodec/evc_parse: zero sps, pps and sh structs
Otherwise stale values may remain in place.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:54 -03:00
James Almer
da2af70ffa avcodec/evc_parser: export framerate to the AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-17 10:08:53 -03:00
James Almer
f42df8384a avcodec/evc_parse: use the correct struct size when allocating pps
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-16 10:08:32 -03:00
Dawid Kozinski
34e4f18360 avcodec/evc_parser: Added parser implementation for EVC format
- Added constants definitions for EVC parser
- Provided NAL units parsing following ISO_IEC_23094-1
- EVC parser registration

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2023-06-15 09:51:04 -03:00