* [FFmpeg-devel] [PR] avcodec/hevc/hevcdec: take into account YUV400 in block length (PR #21632)
@ 2026-02-02 23:11 Valerii Zapodovnikov via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: Valerii Zapodovnikov via ffmpeg-devel @ 2026-02-02 23:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Valerii Zapodovnikov
PR #21632 opened by Valerii Zapodovnikov (Balling)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21632
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21632.patch
Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
See issue #11551.
>From 3e99e52faef8f75bc90d345a1e805ff82e91c622 Mon Sep 17 00:00:00 2001
From: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
Date: Tue, 3 Feb 2026 02:07:15 +0300
Subject: [PATCH] avcodec/hevc/hevcdec: take into account YUV400 in block
length
Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
---
libavcodec/hevc/hevcdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 531d1c26f3..eb5b0af130 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -1668,10 +1668,10 @@ static int hls_pcm_sample(HEVCLocalContext *lc, const HEVCLayerContext *l,
uint8_t *dst1 = &s->cur_frame->f->data[1][(y0 >> sps->vshift[1]) * stride1 + ((x0 >> sps->hshift[1]) << sps->pixel_shift)];
uint8_t *dst2 = &s->cur_frame->f->data[2][(y0 >> sps->vshift[2]) * stride2 + ((x0 >> sps->hshift[2]) << sps->pixel_shift)];
- int length = cb_size * cb_size * sps->pcm.bit_depth +
+ int length = cb_size * cb_size * sps->pcm.bit_depth + (sps->chroma_format_idc != 0 ?
(((cb_size >> sps->hshift[1]) * (cb_size >> sps->vshift[1])) +
((cb_size >> sps->hshift[2]) * (cb_size >> sps->vshift[2]))) *
- sps->pcm.bit_depth_chroma;
+ sps->pcm.bit_depth_chroma : 0);
const uint8_t *pcm = skip_bytes(&lc->cc, (length + 7) >> 3);
int ret;
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-02-02 23:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-02 23:11 [FFmpeg-devel] [PR] avcodec/hevc/hevcdec: take into account YUV400 in block length (PR #21632) Valerii Zapodovnikov via ffmpeg-devel
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