[FFmpeg-devel] [PATCH] Fix quadratic memory use in ff_h2645_extract_rbsp() when multiple NALUs exist in packet.

Kieran Kunhya kierank at obe.tv
Tue Oct 31 03:50:55 EET 2017


On Tue, 31 Oct 2017 at 01:42 Kieran Kunhya <kierank at obe.tv> wrote:

> On Tue, 24 Oct 2017 at 00:56 Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>
>> 2017-10-24 1:43 GMT+02:00 Niki Bowe <nbowe-at-google.com at ffmpeg.org>:
>> > On Thu, Oct 19, 2017 at 3:39 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
>> > wrote:
>>
>> >> Does the patch have a measurable speed impact?
>> >>
>> > Is there a standard set of benchmarks I can run?
>> >
>> > For typical videos the speed impact is small, due to NALU fitting in
>> cache,
>> > but for videos with many large NALUs there can be some slowdown.
>>
>> (5% overall slowdown would make every patch unacceptable
>> but I doubt this is the case.)
>>
>> Use the TIMER makros from libavutil/timer.h, put them around all
>> calls to ff_h2645_extract_rbsp().
>>
>
> Related to https://trac.ffmpeg.org/ticket/6789, we see huge memory
> allocations in this code so if this patch fixes, it should be committed
> irrespective of any speed loss.
>
> Kieran
>

I confirm this patch fixes ticket 6789.

Kieran


More information about the ffmpeg-devel mailing list