[FFmpeg-devel] [PATCH 6/6] avformat/av1: Improve filtering AV1 OBUs

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Jan 27 03:20:49 EET 2020


On Sun, Jan 26, 2020 at 4:54 PM James Almer <jamrial at gmail.com> wrote:

> On 1/23/2020 1:08 PM, Andreas Rheinhardt wrote:
> >
> > +    buf = av_malloc((size_t)len + AV_INPUT_BUFFER_PADDING_SIZE);
>
> We never cast the arguments to av_malloc() to size_t, and len here is
> guaranteed to be <= size by parse_obu_header(), so it's unnecessary.
>
> Removed it and pushed the patch. Thanks.
>

The input data currently always comes from a packet, so that its size is <=
INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE, but there is no requirement that
this always has to be that way. So I added the cast in order to make sure
that no overflow happens during the addition. But I guess it's not
important.

- Andreas

PS: None of the current callers needs the output to be padded, but I
nevertheless retained it.


More information about the ffmpeg-devel mailing list