[FFmpeg-devel] libavutil/imgutils: UBSan nullptr-with-offset in av_image_fill_pointer

Brian Kim bkkim at google.com
Wed Jul 1 21:14:13 EEST 2020


While running under Clang's UndefinedBehaviorSanitizer, I found a few
places where av_image_fill_pointers is called before buffers for the image
are allocated, so ptr is passed in as NULL.

This leads to (currently harmless) UB when the plane sizes are added to the
null pointer, so I was wondering if there was interest in avoiding it?

I've attached a patch to expose some extra utilities and avoid passing in
the null pointer, but is this an appropriate way to work around it?

Thank you,
Brian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavutil-imgutils-add-utility-to-get-plane-sizes.patch
Type: text/x-patch
Size: 8646 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200701/1d45b7d4/attachment.bin>


More information about the ffmpeg-devel mailing list