This format seems to reproduce some of the same issues as QOI:

> The RGB-data should be sRGB for best interoperability and not alpha-
> premultiplied.

This seems to imply it could be something other than sRGB since it says
SHOULD rather than MUST. This probably isn't a huge issue, but it
should be clearer on the website. It also doesn't say whether alpha is
linear or not.

> +    int pkt_size = HEADER_SIZE + av_image_get_buffer_size(
> +        p->format,
> +        p->width,
> +        p->height,
> +        1
> +    );

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).

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.

/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to