[FFmpeg-devel] [PATCH 5/6] avformat/mov: use av_stereo3d_alloc2()

James Almer jamrial at gmail.com
Sun Dec 11 05:33:07 EET 2016


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 0fd9eb0..70c2af1 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -181,6 +181,7 @@ typedef struct MOVStreamContext {
 
     int32_t *display_matrix;
     AVStereo3D *stereo3d;
+    size_t stereo3d_size;
     AVSphericalMapping *spherical;
     size_t spherical_size;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0b1c182..3f8fac7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4535,7 +4535,7 @@ static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         return 0;
     }
 
-    sc->stereo3d = av_stereo3d_alloc();
+    sc->stereo3d = av_stereo3d_alloc2(&sc->stereo3d_size);
     if (!sc->stereo3d)
         return AVERROR(ENOMEM);
 
@@ -4670,7 +4670,7 @@ static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_
             else
                 mode = AV_STEREO3D_2D;
 
-            sc->stereo3d = av_stereo3d_alloc();
+            sc->stereo3d = av_stereo3d_alloc2(&sc->stereo3d_size);
             if (!sc->stereo3d)
                 goto out;
 
@@ -5933,7 +5933,7 @@ static int mov_read_header(AVFormatContext *s)
             if (sc->stereo3d) {
                 err = av_stream_add_side_data(st, AV_PKT_DATA_STEREO3D,
                                               (uint8_t *)sc->stereo3d,
-                                              sizeof(*sc->stereo3d));
+                                              sc->stereo3d_size);
                 if (err < 0)
                     return err;
 
-- 
2.10.2



More information about the ffmpeg-devel mailing list