diff mbox

[FFmpeg-devel] lavu/parseutils: Allow to parse >100 hours

Message ID CAB0OVGr=J5aHiH+F7HagDk9_Q7HjYH+pdLASGeO7x7wex70WzQ@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Feb. 9, 2019, 12:24 a.m. UTC
Hi!

Attached patch fixes ticket #7721 for the reporter.

Please comment, Carl Eugen

Comments

Michael Niedermayer Feb. 9, 2019, 12:27 p.m. UTC | #1
On Sat, Feb 09, 2019 at 01:24:35AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #7721 for the reporter.
> 
> Please comment, Carl Eugen

>  parseutils.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 9771b8afcf3e4d4a5fe55cd63f60a03cc25a117a  0001-lavu-parseutils-Allow-to-parse-100-hours.patch
> From ba6abc57d563bcc22607ff5d9f77fdce76000bf6 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Sat, 9 Feb 2019 01:20:43 +0100
> Subject: [PATCH] lavu/parseutils: Allow to parse >= 100 hours.
> 
> Reported and tested by gamnark.
> Fixes ticket #7721.
> ---
>  libavutil/parseutils.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> index 59bec6c..167e822 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -504,7 +504,7 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
>          switch(c) {
>          case 'H':
>          case 'J':
> -            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, 2);
> +            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, c == 'H' ? 2 : 4);

LGTM until someone needs more than a bit over a year duration



[...]
Carl Eugen Hoyos Feb. 9, 2019, 1 p.m. UTC | #2
2019-02-09 13:27 GMT+01:00, Michael Niedermayer <michaelni@gmx.at>:
> On Sat, Feb 09, 2019 at 01:24:35AM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes ticket #7721 for the reporter.
>>
>> Please comment, Carl Eugen
>
>>  parseutils.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 9771b8afcf3e4d4a5fe55cd63f60a03cc25a117a
>> 0001-lavu-parseutils-Allow-to-parse-100-hours.patch
>> From ba6abc57d563bcc22607ff5d9f77fdce76000bf6 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Sat, 9 Feb 2019 01:20:43 +0100
>> Subject: [PATCH] lavu/parseutils: Allow to parse >= 100 hours.
>>
>> Reported and tested by gamnark.
>> Fixes ticket #7721.
>> ---
>>  libavutil/parseutils.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
>> index 59bec6c..167e822 100644
>> --- a/libavutil/parseutils.c
>> +++ b/libavutil/parseutils.c
>> @@ -504,7 +504,7 @@ char *av_small_strptime(const char *p, const char
>> *fmt, struct tm *dt)
>>          switch(c) {
>>          case 'H':
>>          case 'J':
>> -            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, 2);
>> +            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, c == 'H' ?
>> 2 : 4);
>
> LGTM until someone needs more than a bit over a year duration

:-)
Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

From ba6abc57d563bcc22607ff5d9f77fdce76000bf6 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 9 Feb 2019 01:20:43 +0100
Subject: [PATCH] lavu/parseutils: Allow to parse >= 100 hours.

Reported and tested by gamnark.
Fixes ticket #7721.
---
 libavutil/parseutils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 59bec6c..167e822 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -504,7 +504,7 @@  char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
         switch(c) {
         case 'H':
         case 'J':
-            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, 2);
+            val = date_get_num(&p, 0, c == 'H' ? 23 : INT_MAX, c == 'H' ? 2 : 4);
 
             if (val == -1)
                 return NULL;
-- 
1.7.10.4