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
3e5a7dff
Commit
3e5a7dff
authored
Dec 25, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mov: use ff_get_extradata()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
28cc7062
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
mov.c
libavformat/mov.c
+9
-15
No files found.
libavformat/mov.c
View file @
3e5a7dff
...
...
@@ -1086,9 +1086,8 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
st
->
codec
->
codec_id
==
AV_CODEC_ID_SPEEX
)
{
// pass all frma atom to codec, needed at least for QDMC and QDM2
av_free
(
st
->
codec
->
extradata
);
if
(
ff_
alloc_extradata
(
st
->
codec
,
atom
.
size
)
)
if
(
ff_
get_extradata
(
st
->
codec
,
pb
,
atom
.
size
)
<
0
)
return
AVERROR
(
ENOMEM
);
avio_read
(
pb
,
st
->
codec
->
extradata
,
atom
.
size
);
}
else
if
(
atom
.
size
>
8
)
{
/* to read frma, esds atoms */
int
ret
;
if
((
ret
=
mov_read_default
(
c
,
pb
,
atom
))
<
0
)
...
...
@@ -1123,9 +1122,9 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return
mov_read_default
(
c
,
pb
,
atom
);
}
av_free
(
st
->
codec
->
extradata
);
if
(
ff_
alloc_extradata
(
st
->
codec
,
atom
.
size
)
)
if
(
ff_
get_extradata
(
st
->
codec
,
pb
,
atom
.
size
)
<
0
)
return
AVERROR
(
ENOMEM
);
avio_read
(
pb
,
st
->
codec
->
extradata
,
atom
.
size
);
return
0
;
}
...
...
@@ -1146,13 +1145,10 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if
((
profile_level
&
0xf0
)
!=
0xc0
)
return
0
;
av_free
(
st
->
codec
->
extradata
);
if
(
ff_alloc_extradata
(
st
->
codec
,
atom
.
size
-
7
))
return
AVERROR
(
ENOMEM
);
avio_seek
(
pb
,
6
,
SEEK_CUR
);
ret
=
avio_read
(
pb
,
st
->
codec
->
extradata
,
st
->
codec
->
extradata_size
);
if
(
ret
!=
st
->
codec
->
extradata_size
)
return
ret
<
0
?
ret
:
AVERROR_INVALIDDATA
;
av_free
(
st
->
codec
->
extradata
);
if
(
(
ret
=
ff_get_extradata
(
st
->
codec
,
pb
,
atom
.
size
-
7
))
<
0
)
return
ret
;
return
0
;
}
...
...
@@ -1175,11 +1171,10 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if
((
uint64_t
)
atom
.
size
>
(
1
<<
30
))
return
AVERROR_INVALIDDATA
;
avio_skip
(
pb
,
40
);
av_free
(
st
->
codec
->
extradata
);
if
(
ff_
alloc_extradata
(
st
->
codec
,
atom
.
size
-
40
)
)
if
(
ff_
get_extradata
(
st
->
codec
,
pb
,
atom
.
size
-
40
)
<
0
)
return
AVERROR
(
ENOMEM
);
avio_skip
(
pb
,
40
);
avio_read
(
pb
,
st
->
codec
->
extradata
,
atom
.
size
-
40
);
return
0
;
}
...
...
@@ -1491,9 +1486,8 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
int
size
)
{
if
(
st
->
codec
->
codec_tag
==
MKTAG
(
't'
,
'm'
,
'c'
,
'd'
))
{
if
(
ff_
alloc_extradata
(
st
->
codec
,
size
)
)
if
(
ff_
get_extradata
(
st
->
codec
,
pb
,
size
)
<
0
)
return
AVERROR
(
ENOMEM
);
avio_read
(
pb
,
st
->
codec
->
extradata
,
size
);
if
(
size
>
16
)
{
MOVStreamContext
*
tmcd_ctx
=
st
->
priv_data
;
int
val
;
...
...
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