[FFmpeg-cvslog] avformat/mxfenc: Fix integer overflow in length computation

Michael Niedermayer git at videolan.org
Sun Dec 13 03:30:13 CET 2015


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Dec  9 18:13:25 2015 +0100| [e3f08d9359c35745baa03acffb53154944f43053] | committer: Michael Niedermayer

avformat/mxfenc: Fix integer overflow in length computation

Fixes: CID1341577

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 537e901fe66c326f78e916ee9393830ee366131d)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 66e1f07..9e23bed 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1266,11 +1266,11 @@ static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type,
             user_comment_count = mxf_write_user_comments(s, s->metadata);
         mxf_write_metadata_key(pb, 0x013600);
         PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16);
-        klv_encode_ber_length(pb, 92 + name_size + (16*track_count) + (16*user_comment_count) + 12*mxf->store_user_comments);
+        klv_encode_ber_length(pb, 92 + name_size + (16*track_count) + (16*user_comment_count) + 12LL*mxf->store_user_comments);
     } else {
         mxf_write_metadata_key(pb, 0x013700);
         PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16);
-        klv_encode_ber_length(pb, 112 + name_size + (16*track_count) + 12*mxf->store_user_comments); // 20 bytes length for descriptor reference
+        klv_encode_ber_length(pb, 112 + name_size + (16*track_count) + 12LL*mxf->store_user_comments); // 20 bytes length for descriptor reference
     }
 
     // write uid



More information about the ffmpeg-cvslog mailing list