[FFmpeg-trac] #8871(swscale:new): swscale crops image on yuv2rgb

FFmpeg trac at avcodec.org
Tue Dec 17 17:19:19 EET 2024


#8871: swscale crops image on yuv2rgb
-------------------------------------+-----------------------------------
             Reporter:  xlp          |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  swscale
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-----------------------------------
Comment (by Niklas Haas):

 The problem here, and the reason it is not reproducible with just
 `ffmpeg`, is that the dst buffer stride is not aligned to a multiple of 8,
 which breaks the unscaled special converters.

 This seems to fall into a general class of bugs revolving around calling
 libswscale directly with unaligned buffers,

 cf #6763, #10852, #6763

 It seems that the only general fix to such issues is to either avoid the
 use of asm entirely for unaligned buffers, or just print a big scary
 warning and issue a memcpy from a suitably aligned internal buffer.

 I am leaning towards the latter, as a definitive fix for these issues, all
 of which have in common that they can only happen when one deliberately
 ignores best practices around image buffer alignment.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/8871#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list