]> git.sesse.net Git - ffmpeg/commit
avcodec/av1dec: Check tiles sizes, fix assert, don't read bytes bitwise
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 17 Sep 2020 03:09:19 +0000 (05:09 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 18 Sep 2020 00:34:55 +0000 (02:34 +0200)
commit93b7f9312d691f4a24a5d48bf98f1e1337cac055
tree1047409138dd3badc09283593b522ab06a22e620
parent6ffc7be5da0ece247cf26f1d6b94cd1d6af3d338
avcodec/av1dec: Check tiles sizes, fix assert, don't read bytes bitwise

Tiles have a size field with a length from one to four bytes. As such it
is not possible to read it all at once with a call to get_bits() as this
only allows to read up to 25 bits; this is guarded by an av_assert2. Yet
this is done by the AV1 decoder in get_tiles_info(). It has been done
despite said size fields being byte-aligned. This commit fixes this by
using the bytestream2 API instead.

Furthermore, it is now explicitly checked whether the data is
consistent, i.e. whether the data that is supposed to be there extends
beyond the end of the data actually present.

Reviewed-by: Wang, Fei W <fei.w.wang@intel.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/av1dec.c