avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)

It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.1
James Almer 7 months ago
parent 8a85d3fd39
commit a91f34aad8
  1. 1
      libavformat/isom.h
  2. 6
      libavformat/mov.c

@ -250,6 +250,7 @@ typedef struct MOVStreamContext {
AVSphericalMapping *spherical; AVSphericalMapping *spherical;
size_t spherical_size; size_t spherical_size;
AVMasteringDisplayMetadata *mastering; AVMasteringDisplayMetadata *mastering;
size_t mastering_size;
AVContentLightMetadata *coll; AVContentLightMetadata *coll;
size_t coll_size; size_t coll_size;
AVAmbientViewingEnvironment *ambient; AVAmbientViewingEnvironment *ambient;

@ -6138,7 +6138,7 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, 3); /* flags */ 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) if (!sc->mastering)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -6181,7 +6181,7 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0; return 0;
} }
sc->mastering = av_mastering_display_metadata_alloc(); sc->mastering = av_mastering_display_metadata_alloc_size(&sc->mastering_size);
if (!sc->mastering) if (!sc->mastering)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -10043,7 +10043,7 @@ static int mov_read_header(AVFormatContext *s)
if (sc->mastering) { if (sc->mastering) {
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data, if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
AV_PKT_DATA_MASTERING_DISPLAY_METADATA, 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); return AVERROR(ENOMEM);
sc->mastering = NULL; sc->mastering = NULL;

Loading…
Cancel
Save