summaryrefslogtreecommitdiff
path: root/libavcodec/speedhqenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-10 08:50:37 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-11 02:20:05 +0100
commit628d02a6116ce5401a626254be7bfc0e68756c1d (patch)
tree866c638cc8e306fc5b4eb2ddb901bc6c7dbd3e89 /libavcodec/speedhqenc.c
parent43b4c66e6b7dc788b8c6e4c9cfdb08bfa5ef2360 (diff)
avcodec/speedhqenc: Call correct function
Up until now, the SpeedHQ encoder called a wrong function for init: void ff_init_uni_ac_vlc(const uint8_t huff_size_ac[256], uint8_t *uni_ac_vlc_len); Yet the first argument actually used is of type RLTable; the size of said struct is less than 256 if the size of a pointer is four, leading to an access beyond the end of the RLTable. This commit fixes this by calling the actually intended function: init_uni_ac_vlc() from mpeg12enc.c. It was intended to use this function [1], yet doing so was forgotten when the patch was actually applied. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-July/266187.html Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/speedhqenc.c')
-rw-r--r--libavcodec/speedhqenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 3bda2a8453..51f67c0d5e 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -104,7 +104,7 @@ static av_cold void speedhq_init_static_data(void)
speedhq_chr_dc_uni[i + 255] = bits + (code << 8);
}
- ff_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len);
+ ff_mpeg1_init_uni_ac_vlc(&ff_rl_speedhq, uni_speedhq_ac_vlc_len);
}
av_cold int ff_speedhq_encode_init(MpegEncContext *s)