Michael Niedermayer
1be49cee34
avcodec/h264: Increase field_poc to 64bit in ff_h264_init_poc() to detect overflows
...
Fixes: Integer overflow
Fixes: 5746/clusterfuzz-testcase-minimized-6270097623613440
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
James Almer
5e9b39b373
avcodec/h264_sei: remove redundant prefix to H264SEIFramePacking fields
...
Cosmetic change.
Signed-off-by: James Almer <jamrial@gmail.com>
7 years ago
Kieran Kunhya
03b82b3ab9
h2645_parse: Allocate a single buffer per packet
...
Drastically reduces memory usage on pathological streams.
Fixes ticket #6789
7 years ago
Mark Thompson
6eb102a616
h264_sei: Add namespace prefix to all SEI values
...
This avoids confusion with equivalent H.265 SEI values when both are
being used at the same time.
(cherry picked from commit 6ea220cbee
)
7 years ago
Michael Niedermayer
09096fb687
avcodec/h264_parse: Check picture structure when initializing weight table
...
Fixes: runtime error: index 49 out of bounds for type 'int [48][2][2]'
Fixes: 2159/clusterfuzz-testcase-minimized-5267945972301824
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Mark Thompson
6ea220cbee
h264_sei: Add namespace prefix to all SEI values
...
This avoids confusion with equivalent H.265 SEI values when both are
being used at the same time.
8 years ago
Michael Niedermayer
d7b2bb5391
h264_sei: Check actual presence of picture timing SEI message
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years ago
Michael Niedermayer
6a37abc59a
avcodec/h264_sei: Check actual presence of SEI picture timing instead of implying it
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Diego Biurrun
d4c2103bd3
golomb: Convert to the new bitstream reader
8 years ago
Rodger Combs
f271a9bd99
lavc/h264_parser: export field order in more cases
8 years ago
Paul B Mahol
92dbd65700
avcodec/h264_parser: fix for possible overflow
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
01fa4fb69e
avcodec/h264_parser: set missing pts for top/bottom field frames
...
Adopted from 4eb49fdde8
revert.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Michael Niedermayer
f10ea03df3
avcodec/h264_parser: Factor get_avc_nalsize() out
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
cc13bc8c4f
avcodec/h2645: Fix NAL unit padding
...
The parser changes have lost the support for the needed padding, this adds it back
Fixes out of array reads
Fixes: 03ea21d271abc8acf428d42ace51d8b4/asan_heap-oob_3358eef_5692_16f0cc01ab5225e9ce591659e5c20e35.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
febc862b53
avcodec/h264_parser: Set sps/pps_ref
...
Fixes use of freed memory
Should fix valgrind failures of fate-h264-skip-nointra
Found-by: logan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Benoit Fouet
879330c561
h264: make H264ParamSets sps const
9 years ago
Anton Khirnov
5c2fb561d9
h264: add H264_ prefix to the NAL unit types
...
This will prevent conflicts e.g. in code that deals with both h264 and
hevc.
9 years ago
Anton Khirnov
b24dafe105
lavc: drop unnecessary h264dec.h includes
9 years ago
Anton Khirnov
f638b67e57
h264: move the parameter set definitions to a new header file
...
The PS parsing code is independent from the decoder, so it makes more
sense for it to have its own separate header.
9 years ago
Anton Khirnov
251cbb4400
h264: create a new header for common h264 definitions
...
Move the NAL unit types into it. This will allow to stop including the
whole decoder-specific h264dec.h in some code that is unrelated to the
decoder and only needs some enum values.
9 years ago
Anton Khirnov
9df889a5f1
h264: rename h264.[ch] to h264dec.[ch]
...
This is more consistent with the naming of other decoders.
9 years ago
Matthieu Bouron
0ea58059d6
lavc/h264_ps: add ff_h264_ps_uninit and use it
9 years ago
Clément Bœsch
38a2d9aeec
lavc/h264_parser: replace AVCodecContext with logging ctx in scan_mmco_reset()
9 years ago
Clément Bœsch
4fdea02d68
lavc/h264: add a logging ctx to ff_h264_pred_weight_table()
9 years ago
Clément Bœsch
34ec084b84
lavc/h264: move history parsing variable to H264ParseContext
...
This makes h264_find_frame_end() not depend on H264Context anymore.
9 years ago
Clément Bœsch
48ea5433c8
lavc/h264_parser: pass logctx to h264_find_frame_end()
...
This helps removing the H264Context from the H264ParseContext.
9 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Anton Khirnov
72da8d9bb2
h264_parser: remove the remaining dependencies on the h264 decoder
9 years ago
Anton Khirnov
98c97994c5
h264: decouple extradata parsing from the decoder
...
This will allow decoupling the parser from the decoder.
9 years ago
Anton Khirnov
728d90a0c1
h264: decouple h264_sei from the h264 decoder
...
Make the SEI parsing independent of the H264Context, to allow
decoupling the parser from the decoder.
9 years ago
Anton Khirnov
c8dcff0cdb
h264: factor out calculating the POC count into a separate file
...
This will allow decoupling the parser from the decoder.
9 years ago
Anton Khirnov
113aeee6ae
h264_parser: move the H264DSPContext to the parser context
9 years ago
Anton Khirnov
3176217c60
h264: decouple h264_ps from the h264 decoder
...
Make the SPS/PPS parsing independent of the H264Context, to allow
decoupling the parser from the decoder. The change is modelled after the
one done earlier for HEVC.
Move the dequant buffers to the PPS to avoid complex checks whether they
changed and an expensive copy for frame threads.
9 years ago
Anton Khirnov
44d16df413
h264_parser: eliminate H264SliceContext usage
...
It is no longer needed for anything.
9 years ago
Anton Khirnov
a6e27f7add
h264: factor out parsing the reference count into a separate file
...
This will allow decoupling the parser from the decoder.
9 years ago
Anton Khirnov
e9f884416c
h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()
...
It has nothing to do with the reference count and so does not belong in
this function.
9 years ago
Anton Khirnov
8d0cc8ca97
h264_parser: switch to h2645_parse for NAL unescaping
...
Remove now unused ff_h264_decode_nal().
9 years ago
Anton Khirnov
e481458bc3
h264: factor out pred weight table parsing into a separate file
...
This will allow decoupling the parser from the decoder.
9 years ago
Diego Biurrun
a7da517f6a
h264data: Move all data tables from a header to a .c file
9 years ago
Diego Biurrun
02cd8bb9cb
h264: Clean up #includes
9 years ago
Mark Harris
c51c08e0e7
avcodec: Use get_ue_golomb_long() when needed
...
get_ue_golomb() cannot decode values larger than 8190 (the maximum
value that can be golomb encoded in 25 bits) and produces the error
"Invalid UE golomb code" if a larger value is encountered. Use
get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294)
when valid h264/hevc values can exceed 8190.
This updates decoding of the following values: (maximum)
first_mb_in_slice 36863* for level 5.2
abs_diff_pic_num_minus1 131071
difference_of_pic_nums_minus1 131071
idr_pic_id 65535
recovery_frame_cnt 65535
frame_packing_arrangement_id 4294967294
frame_packing_arrangement_repetition_period 16384
display_orientation_repetition_period 16384
An alternative would be to modify get_ue_golomb() to handle encoded
values of up to 49 bits as was done for get_se_golomb() in a92816c
.
In that case get_ue_golomb() could continue to be used for all of
these except frame_packing_arrangement_id.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Diego Biurrun
8161220eee
h264_parser: Rename close() to h264_close()
...
At least on AIX it conflicts with the close() libc function from unistd.h.
9 years ago
Michael Niedermayer
bc48c88918
avcodec/h264: Do not fail with randomly truncated VUIs
...
Fixes Ticket4445
Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
5bf3c0fa49
h264: drop the now unused per-slice H264Contexts
10 years ago
Anton Khirnov
3178f4d33f
h264: move rbsp_buffer into the per-slice context
10 years ago
Anton Khirnov
f42485dbce
h264: use a separate GetBitContext for slice data
10 years ago
Anton Khirnov
95eb35f305
h264: move the ref lists variables into the per-slice context
10 years ago
Anton Khirnov
56febc993b
h264: move the slice type variables into the per-slice context
10 years ago
Anton Khirnov
92c6c2a605
h264: split weighted pred-related vars into per-slice context
10 years ago
Anton Khirnov
31d2039cb4
h264_parser: export video format and dimensions
10 years ago