• Andreas Rheinhardt's avatar
    avcodec/mpeg12dec: Sanitize start codes earlier · 093b6894
    Andreas Rheinhardt authored
    The MPEG-1/2 decoder uses avpriv_find_start_code to search for start
    codes and worked with the resulting start code before checking that it
    is really a start code of a slice. In particular, if the picture is so
    big that a slice_vertical_position_extension is present, it added the
    slice_vertical_position_extension as if it had a slice. Then a left
    shift is performed, without making sure that the value to be shifted is
    nonnegative.
    Afterwards the end result is checked, but even if a start code of a
    non-slice has been found, it might pass these checks: If
    slice_vertical_position_extension is present a start code <
    SLICE_MIN_START_CODE can lead to a macroblock-row index that appears
    valid. Furthermore, the left shift might make an invalid start code
    appear valid by discarding the highest bit.
    This has been fixed by checking directly after avpriv_find_start_code
    has returned.
    
    Fixes ticket #8162 (which is about the undefined left shifts).
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    093b6894
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...