[FFmpeg-devel] [PATCH 1/4] mxfenc: explicitly truncate continuity count.

Michael Niedermayer michaelni at gmx.at
Mon Oct 15 16:07:31 CEST 2012


The field is intended to overflow and have only its low 16bits stored.
This commit avoids the implicit truncation and clarifies that its
intended and not a bug

Approved-by: Tjoppen
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/mxfenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index b7e9449..6a27d2a 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1820,7 +1820,7 @@ static void mxf_write_system_item(AVFormatContext *s)
     avio_w8(pb, 0x04); // content package rate
     avio_w8(pb, 0x00); // content package type
     avio_wb16(pb, 0x00); // channel handle
-    avio_wb16(pb, mxf->tc.start + frame); // continuity count
+    avio_wb16(pb, (mxf->tc.start + frame) & 0xFFFF); // continuity count, supposed to overflow
     if (mxf->essence_container_count > 1)
         avio_write(pb, multiple_desc_ul, 16);
     else {
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list