1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/jpeg2000dec: Avoid using GetByteContext.buffer directly

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-17 19:07:33 +01:00
parent b48b3250ca
commit 271d6709cf

View File

@ -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);
return 0;
}