[FFmpeg-cvslog] r13207 - trunk/libavformat/cutils.c

cehoyos subversion
Wed May 21 09:05:09 CEST 2008


Author: cehoyos
Date: Wed May 21 09:05:08 2008
New Revision: 13207

Log:
Do not loop endlessly if converting into dv with timestamps Jan 1st not
immediately following a lapyear.

Patch by babupillai.
Fixes issue 443.


Modified:
   trunk/libavformat/cutils.c

Modified: trunk/libavformat/cutils.c
==============================================================================
--- trunk/libavformat/cutils.c	(original)
+++ trunk/libavformat/cutils.c	Wed May 21 09:05:08 2008
@@ -77,11 +77,12 @@ struct tm *brktimegm(time_t secs, struct
 
     /* oh well, may be someone some day will invent a formula for this stuff */
     y = 1970; /* start "guessing" */
-    while (days >= (ISLEAP(y)?366:365)) {
+    while (days > 365) {
         ny = (y + days/366);
         days -= (ny - y) * 365 + LEAPS_COUNT(ny - 1) - LEAPS_COUNT(y - 1);
         y = ny;
     }
+    if (days==365 && !ISLEAP(y)) { days=0; y++; }
     md[1] = ISLEAP(y)?29:28;
     for (m=0; days >= md[m]; m++)
          days -= md[m];




More information about the ffmpeg-cvslog mailing list