avcodec/cbs_h2645: Fix potential out-of-bounds array access
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 18 Sep 2019 03:25:58 +0000 (05:25 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 19 May 2020 22:10:47 +0000 (00:10 +0200)
commitca04589371f9240be31be6323dfec095492ea22e
treef61fb656a13cfc173646f4021e948e4a6609fa6a
parentd2f5691e96d7a2075cf4b4da4b1bbcd872186ccb
avcodec/cbs_h2645: Fix potential out-of-bounds array access

The maximum allowed index for an array access is FF_ARRAY_ELEMS - 1; yet
the current code allowed FF_ARRAY_ELEMS. This wasn't dangerous in practice,
as parameter sets with invalid ids were already filtered out during
reading.

Found via PVS-Studio (see ticket #8156).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit f3333c3c67e8825a4468120bb8aa0943c72c03f3)
libavcodec/cbs_h2645.c