Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8acab7ae
Commit
8acab7ae
authored
May 08, 2011
by
Peter Ross
Committed by
Michael Niedermayer
May 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtv: detect ole date overflow
parent
3dd779eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
wtvdec.c
libavformat/wtvdec.c
+13
-5
No files found.
libavformat/wtvdec.c
View file @
8acab7ae
...
...
@@ -398,11 +398,16 @@ static void crazytime_to_iso8601(char *buf, int buf_size, int64_t value)
/**
* Convert OLE DATE to ISO-8601 string
* @return <0 on error
*/
static
void
oledate_to_iso8601
(
char
*
buf
,
int
buf_size
,
int64_t
value
)
static
int
oledate_to_iso8601
(
char
*
buf
,
int
buf_size
,
int64_t
value
)
{
time_t
t
=
631112400LL
+
86400
*
av_int2dbl
(
value
);
strftime
(
buf
,
buf_size
,
"%Y-%m-%d %H:%M:%S"
,
gmtime
(
&
t
));
struct
tm
result
;
if
(
!
gmtime_r
(
&
t
,
&
result
))
return
-
1
;
strftime
(
buf
,
buf_size
,
"%Y-%m-%d %H:%M:%S"
,
&
result
);
return
0
;
}
static
void
get_attachment
(
AVFormatContext
*
s
,
AVIOContext
*
pb
,
int
length
)
...
...
@@ -463,9 +468,12 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
else
if
(
!
strcmp
(
key
,
"WM/WMRVEncodeTime"
)
||
!
strcmp
(
key
,
"WM/WMRVEndTime"
))
crazytime_to_iso8601
(
buf
,
buf_size
,
num
);
else
if
(
!
strcmp
(
key
,
"WM/WMRVExpirationDate"
))
oledate_to_iso8601
(
buf
,
buf_size
,
num
);
else
if
(
!
strcmp
(
key
,
"WM/WMRVBitrate"
))
else
if
(
!
strcmp
(
key
,
"WM/WMRVExpirationDate"
))
{
if
(
oledate_to_iso8601
(
buf
,
buf_size
,
num
)
<
0
)
{
av_free
(
buf
);
return
;
}
}
else
if
(
!
strcmp
(
key
,
"WM/WMRVBitrate"
))
snprintf
(
buf
,
buf_size
,
"%f"
,
av_int2dbl
(
num
));
else
snprintf
(
buf
,
buf_size
,
"%"
PRIi64
,
num
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment