[FFmpeg-trac] #1853(swscale:new): libswscale writes past scanline end

FFmpeg trac at avcodec.org
Sat Oct 27 13:43:55 CEST 2012

#1853: libswscale writes past scanline end
             Reporter:  gjdfgh   |                     Type:  defect
               Status:  new      |                 Priority:  normal
            Component:  swscale  |                  Version:  unspecified
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
 libswscale sometimes writes to the memory past the end of each scanline,
 into the space between end of scanline and start of the next pixel, or in
 other words, it overwrites pixels between (dstw, y) and (0, y+1).

 Often, this memory is just padding to satisfy alignment constraints on
 strides, but there are use cases where it's reasonable to expect that
 pixels outside the specified destination width should not be overwritten.
 For example, the destination image could be set up as cropped region of a
 larger image, and the regions of the larger images not covered by the
 destination region should not be overwritten.

 I suspect this bug/caveat happens due to use of SIMD to work on multiple
 pixels at once. libswscale should just use an unaccelerated code path to
 handle trailing pixels.

 This happens at least with PIX_FMT_BGRA.

Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1853>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list