[FFmpeg-cvslog] avformat/thp: force moving forward

Michael Niedermayer git at videolan.org
Thu Jan 16 02:46:54 CET 2014


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 31 02:26:07 2013 +0100| [971b13752d921b76d59f0bfea0afb27b0ea3124e] | committer: Michael Niedermayer

avformat/thp: force moving forward

Fixes infinite loop
Fixes Ticket3098

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 6c4b87d3d6ae08a6da16b4616626b4d2a726afbf)

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

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

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

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 09979ac..568807d 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -158,7 +158,7 @@ static int thp_read_packet(AVFormatContext *s,
         avio_seek(pb, thp->next_frame, SEEK_SET);
 
         /* Locate the next frame and read out its size.  */
-        thp->next_frame += thp->next_framesz;
+        thp->next_frame += FFMAX(thp->next_framesz, 1);
         thp->next_framesz = avio_rb32(pb);
 
                         avio_rb32(pb); /* Previous total size.  */



More information about the ffmpeg-cvslog mailing list