Message ID | 20240323192440.38264-9-ffmpeg@haasn.xyz |
---|---|
State | New |
Headers | show |
Series | Dolby Vision extension block parsing | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
On Sat, 23 Mar 2024 20:19:57 +0100 Niklas Haas <ffmpeg@haasn.xyz> wrote: > From: Niklas Haas <git@haasn.dev> > > --- > libavcodec/dovi_rpu.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c > index b3defd87bda..2b4d2b470c2 100644 > --- a/libavcodec/dovi_rpu.c > +++ b/libavcodec/dovi_rpu.c > @@ -94,7 +94,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) > AVFrameSideData *sd; > AVBufferRef *buf; > AVDOVIMetadata *dovi; > - size_t dovi_size; > + size_t dovi_size, ext_sz; > > if (!s->mapping || !s->color) > return 0; /* incomplete dovi metadata */ > @@ -120,6 +120,9 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) > COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag); > COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots); > COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal); > + ext_sz = FFMIN(sizeof(AVDOVIDmData), dovi->ext_block_size); > + for (int i = 0; i < s->num_ext_blocks; i++) > + memcpy(av_dovi_get_ext(dovi, i), &s->ext_blocks[i], ext_sz); Forgot to set dovi->num_ext_blocks = s->num_ext_blocks, fixed. > return 0; > } > > -- > 2.44.0 >
diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index b3defd87bda..2b4d2b470c2 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -94,7 +94,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) AVFrameSideData *sd; AVBufferRef *buf; AVDOVIMetadata *dovi; - size_t dovi_size; + size_t dovi_size, ext_sz; if (!s->mapping || !s->color) return 0; /* incomplete dovi metadata */ @@ -120,6 +120,9 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag); COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots); COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal); + ext_sz = FFMIN(sizeof(AVDOVIDmData), dovi->ext_block_size); + for (int i = 0; i < s->num_ext_blocks; i++) + memcpy(av_dovi_get_ext(dovi, i), &s->ext_blocks[i], ext_sz); return 0; }
From: Niklas Haas <git@haasn.dev> --- libavcodec/dovi_rpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)