summaryrefslogtreecommitdiff
path: root/libavcodec/msmpeg4dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-13 23:02:57 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-17 16:47:29 +0200
commit2d764069be3b4092dc986467660607d922023332 (patch)
tree1504ef9e286b8df559635e97d31ebe767a9e6426 /libavcodec/msmpeg4dec.c
parent97141ffeec803c448d81ee4a53cfa2355f79f7ec (diff)
avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element
In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/msmpeg4dec.c')
-rw-r--r--libavcodec/msmpeg4dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index a03e43f88c..abebeffc7c 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -348,7 +348,7 @@ static av_cold void msmpeg4_decode_init_static(void)
&ff_v2_mb_type[0][0], 2, 1, 128);
for (unsigned i = 0, offset = 0; i < 4; i++) {
- static VLC_TYPE vlc_buf[1636 + 2648 + 1532 + 2488][2];
+ static VLCElem vlc_buf[1636 + 2648 + 1532 + 2488];
ff_mb_non_intra_vlc[i].table = &vlc_buf[offset];
ff_mb_non_intra_vlc[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset;
init_vlc(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128,