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
6f0fc1a9
Commit
6f0fc1a9
authored
Sep 01, 2014
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/ffmdec: return proper error code in ffm2_read_header()
Also log an error message in case of invalid packet size.
parent
39b517fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
ffmdec.c
libavformat/ffmdec.c
+11
-3
No files found.
libavformat/ffmdec.c
View file @
6f0fc1a9
...
@@ -236,10 +236,16 @@ static int ffm2_read_header(AVFormatContext *s)
...
@@ -236,10 +236,16 @@ static int ffm2_read_header(AVFormatContext *s)
AVStream
*
st
;
AVStream
*
st
;
AVIOContext
*
pb
=
s
->
pb
;
AVIOContext
*
pb
=
s
->
pb
;
AVCodecContext
*
codec
;
AVCodecContext
*
codec
;
int
ret
;
ffm
->
packet_size
=
avio_rb32
(
pb
);
ffm
->
packet_size
=
avio_rb32
(
pb
);
if
(
ffm
->
packet_size
!=
FFM_PACKET_SIZE
)
if
(
ffm
->
packet_size
!=
FFM_PACKET_SIZE
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Invalid packet size %d, expected size was %d
\n
"
,
ffm
->
packet_size
,
FFM_PACKET_SIZE
);
ret
=
AVERROR_INVALIDDATA
;
goto
fail
;
goto
fail
;
}
ffm
->
write_index
=
avio_rb64
(
pb
);
ffm
->
write_index
=
avio_rb64
(
pb
);
/* get also filesize */
/* get also filesize */
if
(
pb
->
seekable
)
{
if
(
pb
->
seekable
)
{
...
@@ -266,8 +272,10 @@ static int ffm2_read_header(AVFormatContext *s)
...
@@ -266,8 +272,10 @@ static int ffm2_read_header(AVFormatContext *s)
break
;
break
;
case
MKBETAG
(
'C'
,
'O'
,
'M'
,
'M'
):
case
MKBETAG
(
'C'
,
'O'
,
'M'
,
'M'
):
st
=
avformat_new_stream
(
s
,
NULL
);
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
if
(
!
st
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
}
avpriv_set_pts_info
(
st
,
64
,
1
,
1000000
);
avpriv_set_pts_info
(
st
,
64
,
1
,
1000000
);
...
@@ -359,7 +367,7 @@ static int ffm2_read_header(AVFormatContext *s)
...
@@ -359,7 +367,7 @@ static int ffm2_read_header(AVFormatContext *s)
return
0
;
return
0
;
fail:
fail:
ffm_close
(
s
);
ffm_close
(
s
);
return
-
1
;
return
ret
;
}
}
static
int
ffm_read_header
(
AVFormatContext
*
s
)
static
int
ffm_read_header
(
AVFormatContext
*
s
)
...
...
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