[FFmpeg-devel] [PATCH 5/8] avcodec/smacker: Improve header table error checks

Paul B Mahol onemda at gmail.com
Wed Aug 19 22:26:33 EEST 2020


On 7/31/20, Andreas Rheinhardt <andreas.rheinhardt at gmail.com> wrote:
> The extradata for Smacker video contains Huffman trees as well as a
> field containing the size (in bytes) of said Huffman tree when stored
> as a table. Due to three special values the decoder allocates more than
> the size field indicates; yet when it parses the table it only errors
> out if the number of elements exceeds the number of allocated elements
> and not the number of elements as indicated by the size field. As a
> consequence, there might be less than three elements available at the
> end, so that another check for this is necessary.
>
> This commit changes this: It is always made sure that the three elements
> reserved to (potentially) use them to store the special values are not
> used to store ordinary tree entries. This allows to remove the extra
> check at the end.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavcodec/smacker.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>

Probably OK


More information about the ffmpeg-devel mailing list