[FFmpeg-cvslog] Do not try to read total disc or track number if data atom is too short.

Carl Eugen Hoyos git at videolan.org
Thu Nov 17 14:13:48 CET 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Nov 17 14:12:34 2011 +0100| [d50122eafaa0cc70d6186c3c106c47ed0b3490d9] | committer: Carl Eugen Hoyos

Do not try to read total disc or track number if data atom is too short.

Fixes ticket #659.

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

 libavformat/mov.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 668ff89..e940427 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -87,10 +87,11 @@ static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb,
 {
     char buf[16];
 
-    short current, total;
+    short current, total = 0;
     avio_rb16(pb); // unknown
     current = avio_rb16(pb);
-    total = avio_rb16(pb);
+    if (len >= 6)
+        total = avio_rb16(pb);
     if (!total)
         snprintf(buf, sizeof(buf), "%d", current);
     else



More information about the ffmpeg-cvslog mailing list