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
d3a72bec
Commit
d3a72bec
authored
Oct 05, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yuv4mpeg: return proper error codes.
Fixes Bug 373. CC:libav-stable@libav.org
parent
e4cbf752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
yuv4mpeg.c
libavformat/yuv4mpeg.c
+15
-7
No files found.
libavformat/yuv4mpeg.c
View file @
d3a72bec
...
...
@@ -367,7 +367,7 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int
i
;
char
header
[
MAX_FRAME_HEADER
+
1
];
int
packet_size
,
width
,
height
;
int
packet_size
,
width
,
height
,
ret
;
AVStream
*
st
=
s
->
streams
[
0
];
struct
frame_attributes
*
s1
=
s
->
priv_data
;
...
...
@@ -378,20 +378,28 @@ static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
break
;
}
}
if
(
i
==
MAX_FRAME_HEADER
)
return
-
1
;
if
(
s
->
pb
->
error
)
return
s
->
pb
->
error
;
else
if
(
s
->
pb
->
eof_reached
)
return
AVERROR_EOF
;
else
if
(
i
==
MAX_FRAME_HEADER
)
return
AVERROR_INVALIDDATA
;
if
(
strncmp
(
header
,
Y4M_FRAME_MAGIC
,
strlen
(
Y4M_FRAME_MAGIC
)))
return
-
1
;
return
AVERROR_INVALIDDATA
;
width
=
st
->
codec
->
width
;
height
=
st
->
codec
->
height
;
packet_size
=
avpicture_get_size
(
st
->
codec
->
pix_fmt
,
width
,
height
);
if
(
packet_size
<
0
)
return
-
1
;
return
packet_size
;
if
(
av_get_packet
(
s
->
pb
,
pkt
,
packet_size
)
!=
packet_size
)
return
AVERROR
(
EIO
);
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
packet_size
);
if
(
ret
<
0
)
return
ret
;
else
if
(
ret
!=
packet_size
)
return
s
->
pb
->
eof_reached
?
AVERROR_EOF
:
AVERROR
(
EIO
);
if
(
st
->
codec
->
coded_frame
)
{
st
->
codec
->
coded_frame
->
interlaced_frame
=
s1
->
interlaced_frame
;
...
...
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