Michael Niedermayer
22bec0d33f
avcodec/h2645_parse: Use av_fast_realloc() for nals array
...
Fixes: Timeout (17sec ->281ms)
Fixes: 17833/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5638346914660352
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>
2019-10-06 20:00:59 +02:00
Andreas Rheinhardt
992532ee31
h2645_parse: Make ff_h2645_packet_split reference-compatible
...
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>
2019-01-23 22:33:43 +00:00
Andreas Rheinhardt
e895b800fe
cbs_h2645: Avoid memcpy when splitting fragment
...
Now memcpy is avoided for NAL units that don't contain 0x03 escape
characters.
Improves performance of cbs_h2645_fragment_add_nals from 36940
decicycles to 6364 decicycles based on 8 runs with a 5.1 Mb/s H.264
sample (262144 runs each).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-11-22 23:19:17 +00:00
Kieran Kunhya
03b82b3ab9
h2645_parse: Allocate a single buffer per packet
...
Drastically reduces memory usage on pathological streams.
Fixes ticket #6789
2017-11-04 18:06:45 +00:00
Hendrik Leppkes
2f1a539d4b
Merge commit ' 61bd0ed781'
...
* commit '61bd0ed781 ':
h264: Log more information about invalid NALu size
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-17 15:24:25 +01:00
Michael Niedermayer
f10ea03df3
avcodec/h264_parser: Factor get_avc_nalsize() out
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-20 00:36:38 +02:00
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>
2016-08-18 23:36:18 +02:00
Clément Bœsch
8ef57a0d61
Merge commit ' 41ed7ab45f'
...
* commit '41ed7ab45f ':
cosmetics: Fix spelling mistakes
Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Derek Buitenhuis
79aafd43fd
Merge commit ' 90ed6c5cf7'
...
* commit '90ed6c5cf7 ':
h2645_parse: compute the actual data length, without trailing paddding
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:27:35 +01:00
Derek Buitenhuis
438ed974b8
Merge commit ' b667252a41'
...
* commit 'b667252a41 ':
h2645_parse: add support for parsing h264
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:07:03 +01:00
Derek Buitenhuis
b5c10c4c92
Merge commit ' 52ec149fbe'
...
* commit '52ec149fbe ':
h2645_parse: change the AVCodecContext* parameter to void*
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:04:48 +01:00
Derek Buitenhuis
8e73574d4f
Merge commit ' 8229eff4b7'
...
* commit '8229eff4b7 ':
h2645_parse: add a function for uninitializing the packet
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 14:01:45 +01:00
Derek Buitenhuis
3c4ca4c5d7
Merge commit ' fa936a307f'
...
* commit 'fa936a307f ':
hevc_parse: rename into h2645_parse
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-26 13:56:47 +01:00
Anton Khirnov
90ed6c5cf7
h2645_parse: compute the actual data length, without trailing paddding
...
This is required by h264.
2016-03-28 09:47:25 +02:00
Anton Khirnov
b667252a41
h2645_parse: add support for parsing h264
2016-03-28 09:45:04 +02:00
Anton Khirnov
52ec149fbe
h2645_parse: change the AVCodecContext* parameter to void*
...
This should make it more clear that it is not supposed to be used for
anything except logging.
2016-03-28 09:43:31 +02:00
Anton Khirnov
8229eff4b7
h2645_parse: add a function for uninitializing the packet
2016-03-28 09:43:18 +02:00
Anton Khirnov
fa936a307f
hevc_parse: rename into h2645_parse
...
This code will be shared with h264.
2016-03-28 09:42:44 +02:00