xmv: Add more sanity checks for parameters read from the bitstream
authorMartin Storsjö <martin@martin.st>
Mon, 16 Sep 2013 18:27:49 +0000 (21:27 +0300)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 7 Jan 2014 08:43:56 +0000 (09:43 +0100)
commit0a23055b8ab24800774a7079921791acb92fe0f2
tree03dfe8a1f75514af1fa1b73098184765616da137
parent2b71a7884196413d39b90549e58c4488a8f83953
xmv: Add more sanity checks for parameters read from the bitstream

Since the number of channels is multiplied by 36 and assigned to
to a uint16_t, make sure this calculation didn't overflow. (In
certain cases the calculation could overflow leaving the
truncated block_align at 0, leading to divisions by zero later.)

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d4c2a3740fb95f952a87ba320d2bf31f126bdf68)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 00516b5491fbd99e4057f21eae231fc02cc596e3)
libavformat/xmv.c