Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/cbs_jpeg: Fix size of huffman symbol table array
Date: Fri, 11 Feb 2022 10:28:03 +0100
Message-ID: <AM7PR03MB66605C3733D1D59B3756D7568F309@AM7PR03MB6660.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <AM7PR03MB66606E1CA7B99EBF74E10A778F2D9@AM7PR03MB6660.eurprd03.prod.outlook.com>

Andreas Rheinhardt:
> 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>
> ---
>  libavcodec/cbs_jpeg.h                 | 2 +-
>  libavcodec/cbs_jpeg_syntax_template.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/cbs_jpeg.h b/libavcodec/cbs_jpeg.h
> index 6305f0ee86..9dbebd259f 100644
> --- a/libavcodec/cbs_jpeg.h
> +++ b/libavcodec/cbs_jpeg.h
> @@ -99,7 +99,7 @@ typedef struct JPEGRawHuffmanTable {
>      uint8_t  Tc;
>      uint8_t  Th;
>      uint8_t  L[16];
> -    uint8_t  V[224];
> +    uint8_t  V[256];
>  } JPEGRawHuffmanTable;
>  
>  typedef struct JPEGRawHuffmanTableSpecification {
> 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;

Will apply this later tonight unless there are objections.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-02-11  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08  9:41 Andreas Rheinhardt
2022-02-11  9:28 ` Andreas Rheinhardt [this message]
2022-04-30 17:16 ` Mark Thompson
2022-04-30 18:38   ` Andreas Rheinhardt
2022-04-30 19:18     ` Mark Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM7PR03MB66605C3733D1D59B3756D7568F309@AM7PR03MB6660.eurprd03.prod.outlook.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git