diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-09-20 00:16:57 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-09-26 14:09:14 +0200 |
commit | 093b6894bfc2a8f0804f1c774bfe7827e44ffdb2 (patch) | |
tree | f165ba8f69a6d6cac7030422dc3caf74564c51fb /tools/murge | |
parent | 5886153dc3d3cc3730379391024148b4f141e6fe (diff) | |
download | ffmpeg-093b6894bfc2a8f0804f1c774bfe7827e44ffdb2.tar.gz |
avcodec/mpeg12dec: Sanitize start codes earlier
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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'tools/murge')
0 files changed, 0 insertions, 0 deletions