• Andreas Rheinhardt's avatar
    avcodec/zmbvenc: Correct offset in buffer · def04022
    Andreas Rheinhardt authored
    zmbvenc allocates a buffer for a picture with padding on all four sides:
    The stride is choosen so large that it already contains padding on the
    right; the height also includes padding rows. The padding on the right
    of each row is also reused as padding for the left of the next row. So
    one still needs to add padding on the left for the first row. This is done
    by offsetting the actual pointer used to access the picture from the
    pointer returned by av_mallocz and the formula for this offset was
    wrong, because it ignored that a pixel can take more than one byte when
    calculating the offset resulting from the left padding of the first row.
    
    This fixes accesses outside of the allocated buffer that were reported
    in tickets #7980 and #7994. No writes were ever attempted outside of
    the buffer.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Reviewed-by: 's avatarTomas Härdin <tjoppen@acc.umu.se>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    def04022
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...