[FFmpeg-cvslog] mxfdec: fix potential integer overflow in mxf_compute_sample_count()

Michael Niedermayer git at videolan.org
Sat Nov 17 02:43:40 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 17 02:20:50 2012 +0100| [caedd51e56e2ad47991a1b8bddcfaa8f7094a060] | committer: Michael Niedermayer

mxfdec: fix potential integer overflow in mxf_compute_sample_count()

Fixes CID743442
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mxfdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 1c4e00e..06bca10 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2040,7 +2040,7 @@ static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, uint64_t
 
     av_assert2(size);
 
-    *sample_count = (mxf->current_edit_unit / size) * total;
+    *sample_count = (mxf->current_edit_unit / size) * (uint64_t)total;
     for (i = 0; i < mxf->current_edit_unit % size; i++) {
         *sample_count += spf->samples_per_frame[i];
     }



More information about the ffmpeg-cvslog mailing list