diff mbox series

[FFmpeg-devel,09/10,v3] avformat/mov: don't use sizeof(AVStereo3D)

Message ID 20240622231520.7410-9-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/10,v4] avutil/stereo3d: add a Monoscopic view enum value | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer June 22, 2024, 11:15 p.m. UTC
It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/isom.h |  1 +
 libavformat/mov.c  | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 35b767a52c..a0498f45e5 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -247,6 +247,7 @@  typedef struct MOVStreamContext {
 
     int32_t *display_matrix;
     AVStereo3D *stereo3d;
+    size_t stereo3d_size;
     AVSphericalMapping *spherical;
     size_t spherical_size;
     AVMasteringDisplayMetadata *mastering;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b0930b2936..650b5c2a40 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6334,7 +6334,7 @@  static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         return 0;
     }
 
-    sc->stereo3d = av_stereo3d_alloc();
+    sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
     if (!sc->stereo3d)
         return AVERROR(ENOMEM);
 
@@ -6698,7 +6698,7 @@  static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
 
     if (!sc->stereo3d) {
-        sc->stereo3d = av_stereo3d_alloc();
+        sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
         if (!sc->stereo3d)
             return AVERROR(ENOMEM);
     }
@@ -6785,7 +6785,7 @@  static int mov_read_hfov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
 
     if (!sc->stereo3d) {
-        sc->stereo3d = av_stereo3d_alloc();
+        sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
         if (!sc->stereo3d)
             return AVERROR(ENOMEM);
     }
@@ -6837,7 +6837,7 @@  static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_
                 view = AV_STEREO3D_VIEW_MONO;
             }
 
-            sc->stereo3d = av_stereo3d_alloc();
+            sc->stereo3d = av_stereo3d_alloc_size(&sc->stereo3d_size);
             if (!sc->stereo3d)
                 goto out;
 
@@ -10039,7 +10039,7 @@  static int mov_read_header(AVFormatContext *s)
             if (sc->stereo3d) {
                 if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
                                              AV_PKT_DATA_STEREO3D,
-                                             (uint8_t *)sc->stereo3d, sizeof(*sc->stereo3d), 0))
+                                             (uint8_t *)sc->stereo3d, sc->stereo3d_size, 0))
                     return AVERROR(ENOMEM);
 
                 sc->stereo3d = NULL;