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

marcus marcus at marcusspencer.xyz
Mon Jun 3 22:16:32 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.
Did you incorrectly format that message? Or did you really mean that the UB when the size is greater than INT_MAX doesn't affect my patch?
> 
> /Tomass


More information about the ffmpeg-devel mailing list