Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Tomas Härdin" <git@haerdin.se>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 2/4] avcodec/jpeg2000dec: Avoid using GetByteContext.buffer directly
Date: Mon, 19 Feb 2024 15:00:35 +0100
Message-ID: <157fd91ae2cfbfa9635f555d651a4e9e6d511fb5.camel@haerdin.se> (raw)
In-Reply-To: <GV1SPRMB0063DC6E9F566EDFB8761E588F532@GV1SPRMB0063.EURP250.PROD.OUTLOOK.COM>

lör 2024-02-17 klockan 21:05 +0100 skrev Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/jpeg2000dec.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> index 3d18d48e7c..1afc6b1e2d 100644
> --- a/libavcodec/jpeg2000dec.c
> +++ b/libavcodec/jpeg2000dec.c
> @@ -886,8 +886,8 @@ static int get_ppm(Jpeg2000DecoderContext *s, int
> n)
>          return AVERROR(ENOMEM);
>      s->has_ppm = 1;
>      memset(&s->packed_headers_stream, 0, sizeof(s-
> >packed_headers_stream));
> -    bytestream_get_buffer(&s->g.buffer, s->packed_headers + s-
> >packed_headers_size,
> -                          n - 3);
> +    bytestream2_get_bufferu(&s->g, s->packed_headers + s-
> >packed_headers_size,
> +                            n - 3);
>      s->packed_headers_size += n - 3;
>  
>      return 0;
> @@ -921,10 +921,8 @@ static int get_ppt(Jpeg2000DecoderContext *s,
> int n)
>      } else
>          return AVERROR(ENOMEM);
>      memset(&tile->packed_headers_stream, 0, sizeof(tile-
> >packed_headers_stream));
> -    memcpy(tile->packed_headers + tile->packed_headers_size,
> -           s->g.buffer, n - 3);
> +    bytestream2_get_bufferu(&s->g, tile->packed_headers + tile-
> >packed_headers_size, n - 3);
>      tile->packed_headers_size += n - 3;
> -    bytestream2_skip(&s->g, n - 3);

Looks OK. bytestream2_get_bufferu() seems to do the skipping for us.

/Tomas
_______________________________________________
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:[~2024-02-19 14:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 19:54 [FFmpeg-devel] [PATCH 1/4] avcodec/jpeg2000dec, j2kenc: Constify where appropriate Andreas Rheinhardt
2024-02-17 20:05 ` [FFmpeg-devel] [PATCH 2/4] avcodec/jpeg2000dec: Avoid using GetByteContext.buffer directly Andreas Rheinhardt
2024-02-19 14:00   ` Tomas Härdin [this message]
2024-02-17 20:05 ` [FFmpeg-devel] [PATCH 3/4] avcodec/jpeg2000: Simplify exp2fi for numbers used here Andreas Rheinhardt
2024-02-19 14:09   ` Tomas Härdin
2024-02-19 14:14     ` Andreas Rheinhardt
2024-02-19 14:51       ` Tomas Härdin
2024-02-17 20:05 ` [FFmpeg-devel] [PATCH 4/4] avcodec/internal: Move ff_exp2fi() to aacsbr.c Andreas Rheinhardt
2024-02-19 11:30 ` [FFmpeg-devel] [PATCH 1/4] avcodec/jpeg2000dec, j2kenc: Constify where appropriate Andreas Rheinhardt
2024-02-19 13:58 ` Tomas Härdin

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=157fd91ae2cfbfa9635f555d651a4e9e6d511fb5.camel@haerdin.se \
    --to=git@haerdin.se \
    --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