summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_jpeg_syntax_template.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-02-08 09:59:59 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-02-11 19:38:40 +0100
commit321c31cfe632cf7763e2e09765d59f1ab40abf3a (patch)
treea2201fe282aed379ad2332165be076b7e2b3523b /libavcodec/cbs_jpeg_syntax_template.c
parent0dd1ff67c8a5b687f4b9beb51b425ef7fb8b72c1 (diff)
downloadffmpeg-321c31cfe632cf7763e2e09765d59f1ab40abf3a.tar.gz
avcodec/cbs_jpeg: Fix size of huffman symbol table array
L[i] can be in the range of 0-255, see table B.5 of ITU T.81. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/cbs_jpeg_syntax_template.c')
-rw-r--r--libavcodec/cbs_jpeg_syntax_template.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/cbs_jpeg_syntax_template.c b/libavcodec/cbs_jpeg_syntax_template.c
index 6eda56d623..e06abdc674 100644
--- a/libavcodec/cbs_jpeg_syntax_template.c
+++ b/libavcodec/cbs_jpeg_syntax_template.c
@@ -84,12 +84,12 @@ static int FUNC(huffman_table)(CodedBitstreamContext *ctx, RWContext *rw,
u(4, Th, 0, 3);
for (i = 0; i < 16; i++)
- us(8, L[i], i, 0, 224);
+ us(8, L[i], i, 0, 255);
ij = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < current->L[i]; j++) {
- if (ij >= 224)
+ if (ij >= FF_ARRAY_ELEMS(current->V))
return AVERROR_INVALIDDATA;
us(8, V[ij], ij, 0, 255);
++ij;