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
d74af893
Commit
d74af893
authored
Sep 07, 2012
by
Tomas Härdin
Committed by
Michael Niedermayer
Sep 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2dec: Don't leave AVIOContexts open on zero byte files
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
fa851185
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
img2dec.c
libavformat/img2dec.c
+3
-3
No files found.
libavformat/img2dec.c
View file @
d74af893
...
...
@@ -330,7 +330,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
char
*
filename
=
filename_bytes
;
int
i
;
int
size
[
3
]
=
{
0
},
ret
[
3
]
=
{
0
};
AVIOContext
*
f
[
3
];
AVIOContext
*
f
[
3
]
=
{
NULL
}
;
AVCodecContext
*
codec
=
s1
->
streams
[
0
]
->
codec
;
if
(
!
s
->
is_pipe
)
{
...
...
@@ -352,7 +352,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
for
(
i
=
0
;
i
<
3
;
i
++
){
if
(
avio_open2
(
&
f
[
i
],
filename
,
AVIO_FLAG_READ
,
&
s1
->
interrupt_callback
,
NULL
)
<
0
)
{
if
(
i
=
=
1
)
if
(
i
>
=
1
)
break
;
av_log
(
s1
,
AV_LOG_ERROR
,
"Could not open file : %s
\n
"
,
filename
);
return
AVERROR
(
EIO
);
...
...
@@ -379,7 +379,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
pkt
->
size
=
0
;
for
(
i
=
0
;
i
<
3
;
i
++
){
if
(
size
[
i
]){
if
(
f
[
i
]){
ret
[
i
]
=
avio_read
(
f
[
i
],
pkt
->
data
+
pkt
->
size
,
size
[
i
]);
if
(
!
s
->
is_pipe
)
avio_close
(
f
[
i
]);
...
...
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