[FFmpeg-cvslog] matroska: Read only the data written in the scratch buffer

Luca Barbato git at videolan.org
Thu Oct 26 22:41:47 EEST 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Apr  7 11:41:27 2017 +0200| [d32d59bc977b43031007bb2ab21e232f96d2ebcb] | committer: Luca Barbato

matroska: Read only the data written in the scratch buffer

The private buffer is 20bytes but depending on the type only 12 bytes
are actually filled.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d32d59bc977b43031007bb2ab21e232f96d2ebcb
---

 libavformat/matroskaenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 34d983324b..b8c434a664 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -686,7 +686,7 @@ static int mkv_write_video_projection(AVFormatContext *s, AVIOContext *pb,
         avio_wb32(&b, spherical->bound_left);
         avio_wb32(&b, spherical->bound_right);
         put_ebml_binary(dyn_cp, MATROSKA_ID_VIDEOPROJECTIONPRIVATE,
-                        private, sizeof(private));
+                        private, avio_tell(&b));
         break;
     case AV_SPHERICAL_CUBEMAP:
         ffio_init_context(&b, private, 12, 1, NULL, NULL, NULL, NULL);
@@ -696,7 +696,7 @@ static int mkv_write_video_projection(AVFormatContext *s, AVIOContext *pb,
         avio_wb32(&b, 0); // layout
         avio_wb32(&b, spherical->padding);
         put_ebml_binary(dyn_cp, MATROSKA_ID_VIDEOPROJECTIONPRIVATE,
-                        private, sizeof(private));
+                        private, avio_tell(&b));
         break;
     default:
         av_log(s, AV_LOG_WARNING, "Unknown projection type\n");



More information about the ffmpeg-cvslog mailing list