[FFmpeg-devel] [PATCH v2] avcodec: add farbfeld encoder

Tomas Härdin git at haerdin.se
Mon Jun 3 15:35:17 EEST 2024


> Check the return value of av_image_get_buffer_size() before adding
> HEADER_SIZE to it. There will be a signed overflow (UB) for images of
> size 16385x16385 (and many others).

Sorry, I missed the multiplication by h+128 in av_image_check_size2().
So this isn't a problem in this specific case.

> Aside: av_image_get_buffer_size() will UB for sizes above INT_MAX
> because the size_t's in sizes[] get accumulated into an int. Besides
> the UB it also returns incorrect values.

This however *is* a problem for planar formats. This doesn't affect
this patch however.

/Tomass


More information about the ffmpeg-devel mailing list