aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-06-19 15:19:56 -0300
committerJames Almer <jamrial@gmail.com>2024-06-20 17:04:03 -0300
commita91f34aad84a1643e8aaadbf8a6204828712731d (patch)
tree53fae0214d1083158ce4393364d71782db0fe25d /libavformat
parent8a85d3fd39a0ab12c92c130c6e1764336854632f (diff)
downloadffmpeg-a91f34aad84a1643e8aaadbf8a6204828712731d.tar.gz
avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)
It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/isom.h1
-rw-r--r--libavformat/mov.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h
index c0a5788e08..35b767a52c 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -250,6 +250,7 @@ typedef struct MOVStreamContext {
AVSphericalMapping *spherical;
size_t spherical_size;
AVMasteringDisplayMetadata *mastering;
+ size_t mastering_size;
AVContentLightMetadata *coll;
size_t coll_size;
AVAmbientViewingEnvironment *ambient;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 367af8478b..2d5b24b9a9 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6138,7 +6138,7 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, 3); /* flags */
- sc->mastering = av_mastering_display_metadata_alloc();
+ sc->mastering = av_mastering_display_metadata_alloc_size(&sc->mastering_size);
if (!sc->mastering)
return AVERROR(ENOMEM);
@@ -6181,7 +6181,7 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
- sc->mastering = av_mastering_display_metadata_alloc();
+ sc->mastering = av_mastering_display_metadata_alloc_size(&sc->mastering_size);
if (!sc->mastering)
return AVERROR(ENOMEM);
@@ -10043,7 +10043,7 @@ static int mov_read_header(AVFormatContext *s)
if (sc->mastering) {
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
- (uint8_t *)sc->mastering, sizeof(*sc->mastering), 0))
+ (uint8_t *)sc->mastering, sc->mastering_size, 0))
return AVERROR(ENOMEM);
sc->mastering = NULL;