On Thu, May 18, 2017 at 10:44 AM, Nicolas George <geo...@nsup.org> wrote: > Le nonidi 29 floréal, an CCXXV, Hendrik Leppkes a écrit : >> I wonder if there should be an exception in here somewhere for >> hardware pixelformats, there is no reason to assume the hardware >> pointers passed in AVFrame would be aligned, and aligning them would >> cause all sorts of crashes. >> Best case from an API standpoint would be if av_frame_check_align can >> just claim hardware frames are aligned, so users don't have to >> replicate that check. > > Possible, but I think setting the correct value for alignment is the > best way of dealing with this kind of issue. >
I think its a saner choice to design the API to try to avoid instant heap corruption, instead of hoping every case sets the alignment properly in all cases. A single if condition shouldn't be too much trouble, we already flag hardware pixel formats as such in the pixdesc to identify them. - Hendrik _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel