summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_parse.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/h264: Fix poc_lsb in open gop contextNicolas Gaullier2019-09-101-0/+2
| | | | | When no IDR nor mmco_reset is found, prev_poc_lsb is undefined and shall not be assumed to be zero
* avcodec/h264_parse: retry decoding SPS with complete NALJun Li2019-08-231-2/+13
| | | | | | | | | | Fix #6591 The content has no rbsp_stop_one_bit for ending the SPS, that causes the decoding SPS failure, results decoding frame failure as well. The patch is just adding a retry with complete NALU, copied from the retry in decode_nal_unit() Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_parse: Use 64bit for expectedpoc and expected_delta_per_poc_cycleMichael Niedermayer2019-06-121-1/+2
| | | | | | | | | Fixes: signed integer overflow: -2142516591 + -267814575 cannot be represented in type 'int' Fixes: 14450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5716105319940096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_parse: Clear ref_list[1] if only [0] is usedMichael Niedermayer2019-02-081-0/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_parse: no need check ref list1 for P slices.Decai Lin2019-02-081-5/+6
| | | | | | | | This is robust for some corner case there is incorrect list1 count in pps header, but it's a P slice and can be decoded well. Signed-off-by: Decai Lin <decai.lin@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* h2645_parse: Make ff_h2645_packet_split reference-compatibleAndreas Rheinhardt2019-01-231-1/+1
| | | | | | | This is in preparation for a patch for cbs_h2645. Now the packet's rbsp_buffer can be owned by an AVBuffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* lavc/h264_parse: Remove a superfluous linebreak.Carl Eugen Hoyos2018-05-221-1/+1
|
* avcodec/h264_parse: Clear invalid chroma weights in ff_h264_pred_weight_table()Michael Niedermayer2018-02-201-1/+4
| | | | | | | | Fixes: 6037/clusterfuzz-testcase-minimized-5030249784934400 Fixes: signed integer overflow: 256 * 16992036 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264: Increase field_poc to 64bit in ff_h264_init_poc() to detect ↵Michael Niedermayer2018-02-171-1/+5
| | | | | | | | | | 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>
* avcodec/h264_parse: Treat escaped and unescaped decoding error equal in ↵Michael Niedermayer2017-12-031-3/+2
| | | | | | | | | decode_extradata_ps_mp4() Fixes: lorex.mp4 Fixes: ticket6762 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/h264_parse: don't use uninitialized value when chroma_format_idc==0Mark Wachsler2017-09-081-12/+15
| | | | | | | | | When parsing a monochrome file, chroma_log2_weight_denom was used without being initialized, which could lead to a bogus error message being printed, e.g. [h264 @ 0x61a000026480] chroma_log2_weight_denom 24576 is out of range It also could led to warnings using AddressSanitizer. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_parse: Check picture structure when initializing weight tableMichael Niedermayer2017-06-101-6/+9
| | | | | | | | 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>
* avcodec/h264: Check weight values to be within the specs limits.Michael Niedermayer2017-04-071-0/+9
| | | | | | | | | Fixes: integer overflows Fixes: 911/clusterfuzz-testcase-5415105606975488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h2645: Fix NAL unit paddingMichael Niedermayer2016-08-181-1/+1
| | | | | | | | | 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>
* Merge commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c'James Almer2016-08-011-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c': h264: add H264_ prefix to the NAL unit types Conflicts: libavcodec/h264_parse.c libavcodec/h264_parser.c libavcodec/h264_slice.c libavcodec/h264dec.c Merged-by: James Almer <jamrial@gmail.com>
| * h264: add H264_ prefix to the NAL unit typesAnton Khirnov2016-06-211-2/+2
| | | | | | | | | | This will prevent conflicts e.g. in code that deals with both h264 and hevc.
* | Merge commit 'f638b67e5790735f34620bf82025c9b9d6fc7216'James Almer2016-08-011-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'f638b67e5790735f34620bf82025c9b9d6fc7216': h264: move the parameter set definitions to a new header file Conflicts: libavcodec/h264_parse.h libavcodec/h264_ps.c libavcodec/h264dec.h Merged-by: James Almer <jamrial@gmail.com>
| * h264: move the parameter set definitions to a new header fileAnton Khirnov2016-06-211-0/+1
| | | | | | | | | | The PS parsing code is independent from the decoder, so it makes more sense for it to have its own separate header.
* | Merge commit '251cbb44003caf179fb17afbb8a6c56643c2a646'Clément Bœsch2016-07-291-0/+1
|\ \ | |/ | | | | | | | | | | * commit '251cbb44003caf179fb17afbb8a6c56643c2a646': h264: create a new header for common h264 definitions Merged-by: Clément Bœsch <u@pkh.me>
| * h264: create a new header for common h264 definitionsAnton Khirnov2016-06-211-0/+1
| | | | | | | | | | | | 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.
* | Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'Clément Bœsch2016-07-291-1/+1
|\ \ | |/ | | | | | | | | | | * commit '9df889a5f116c1ee78c2f239e0ba599c492431aa': h264: rename h264.[ch] to h264dec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
| * h264: rename h264.[ch] to h264dec.[ch]Anton Khirnov2016-06-211-1/+1
| | | | | | | | This is more consistent with the naming of other decoders.
* | Merge commit 'b16e9b9ac9db449cae2242767dd3c3fc309357c4'Clément Bœsch2016-06-291-1/+9
|\ \ | |/ | | | | | | | | | | * commit 'b16e9b9ac9db449cae2242767dd3c3fc309357c4': h264: move initialising the explicit pred weight table for MBAFF Merged-by: Clément Bœsch <clement@stupeflix.com>
| * h264: move initialising the explicit pred weight table for MBAFFAnton Khirnov2016-06-121-1/+9
| | | | | | | | | | | | | | Currently it's done in the code that initialises the ref list for MBAFF, which is not a logical place for it. Move it to the function that parses the pred table from the bitstream, which is analogous to what is done for the implicit weight table as well.
* | lavc/h264: add a logging ctx to ff_h264_pred_weight_table()Clément Bœsch2016-06-201-3/+3
| |
* | Merge commit '72da8d9bb24d1b1bf74c2f1108650c0da0054d2e'Clément Bœsch2016-06-191-0/+27
|\ \ | |/ | | | | | | | | | | * commit '72da8d9bb24d1b1bf74c2f1108650c0da0054d2e': h264_parser: remove the remaining dependencies on the h264 decoder Merged-by: Clément Bœsch <u@pkh.me>
| * h264_parser: remove the remaining dependencies on the h264 decoderAnton Khirnov2016-04-241-0/+27
| |
* | Merge commit '98c97994c5b90bdae02accb155eeceeb5224b8ef'Clément Bœsch2016-06-191-0/+149
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '98c97994c5b90bdae02accb155eeceeb5224b8ef': h264: decouple extradata parsing from the decoder Main changes: - move get_avc_nalsize() inside h264_parser.c and make it use H264ParseContext instead of H264Context. This helps fixing fate-flv-demux. - Also use is_avc/nal_length_size from the H264ParseContext in various places instead of the H264Context one as that's the fields now filled by ff_h264_decode_extradata() - h264_parse: dont fail decode_extradata_ps() due to nal split failure. Change by Michael to fix decoding of h264/ref_10.avi. Merged-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
| * h264: decouple extradata parsing from the decoderAnton Khirnov2016-04-241-0/+144
| | | | | | | | This will allow decoupling the parser from the decoder.
* | lavc/h264_parse: remove tabs introduced in a2922b5dClément Bœsch2016-06-181-1/+1
| |
* | Merge commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8'Clément Bœsch2016-06-121-0/+80
|\ \ | |/ | | | | | | | | | | * commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8': h264: factor out calculating the POC count into a separate file Merged-by: Clément Bœsch <u@pkh.me>
| * h264: factor out calculating the POC count into a separate fileAnton Khirnov2016-04-241-0/+80
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit '71d3305c2711d4f6ec8b92db09ff64cf4e19a58e'Derek Buitenhuis2016-05-171-1/+6
|\ \ | |/ | | | | | | | | | | * commit '71d3305c2711d4f6ec8b92db09ff64cf4e19a58e': h264_parse: make sure the ref count is zeroed on all failure paths Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264_parse: make sure the ref count is zeroed on all failure pathsAnton Khirnov2016-04-241-6/+9
| |
* | Merge commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa'Derek Buitenhuis2016-05-171-0/+48
|\ \ | |/ | | | | | | | | | | * commit 'a6e27f7add2698fdd89911632b570c3d0c3f2aaa': h264: factor out parsing the reference count into a separate file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: factor out parsing the reference count into a separate fileAnton Khirnov2016-04-241-0/+46
| | | | | | | | This will allow decoupling the parser from the decoder.
* | Merge commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad'Derek Buitenhuis2016-04-271-0/+92
|\ \ | |/ | | | | | | | | | | * commit 'ecc31f6b086453ab9811dce2ae5ceb6a7c19e4ad': h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parse Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * h264: move ff_h264_check_intra[4x4]_pred_mode() to h264_parseAnton Khirnov2016-03-281-0/+92
| | | | | | | | It is shared with svq3.
* | Merge commit 'e481458bc308ee838deaeacac51929514762e7a7'Derek Buitenhuis2016-04-261-4/+14
|/ | | | | | | * commit 'e481458bc308ee838deaeacac51929514762e7a7': h264: factor out pred weight table parsing into a separate file Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* h264: factor out pred weight table parsing into a separate fileAnton Khirnov2016-03-281-0/+86
This will allow decoupling the parser from the decoder.
OpenPOWER on IntegriCloud