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
01dd7e02
Commit
01dd7e02
authored
Sep 29, 2015
by
Przemysław Sobala
Committed by
Michael Niedermayer
Sep 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/img2dec: Fix memory leak
Fixes #4886 Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
ed18c49f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
img2dec.c
libavformat/img2dec.c
+23
-9
No files found.
libavformat/img2dec.c
View file @
01dd7e02
...
...
@@ -444,14 +444,17 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
}
res
=
av_new_packet
(
pkt
,
size
[
0
]
+
size
[
1
]
+
size
[
2
]);
if
(
res
<
0
)
return
res
;
if
(
res
<
0
)
{
goto
fail
;
}
pkt
->
stream_index
=
0
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
if
(
s
->
ts_from_file
)
{
struct
stat
img_stat
;
if
(
stat
(
filename
,
&
img_stat
))
return
AVERROR
(
EIO
);
if
(
stat
(
filename
,
&
img_stat
))
{
res
=
AVERROR
(
EIO
);
goto
fail
;
}
pkt
->
pts
=
(
int64_t
)
img_stat
.
st_mtime
;
#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
if
(
s
->
ts_from_file
==
2
)
...
...
@@ -485,18 +488,29 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if
(
ret
[
0
]
<=
0
||
ret
[
1
]
<
0
||
ret
[
2
]
<
0
)
{
av_free_packet
(
pkt
);
if
(
ret
[
0
]
<
0
)
{
re
turn
ret
[
0
];
re
s
=
ret
[
0
];
}
else
if
(
ret
[
1
]
<
0
)
{
return
ret
[
1
];
}
else
if
(
ret
[
2
]
<
0
)
return
ret
[
2
];
return
AVERROR_EOF
;
res
=
ret
[
1
];
}
else
if
(
ret
[
2
]
<
0
)
{
res
=
ret
[
2
];
}
else
{
res
=
AVERROR_EOF
;
}
goto
fail
;
}
else
{
s
->
img_count
++
;
s
->
img_number
++
;
s
->
pts
++
;
return
0
;
}
fail:
if
(
!
s
->
is_pipe
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
avio_closep
(
&
f
[
i
]);
}
}
return
res
;
}
static
int
img_read_close
(
struct
AVFormatContext
*
s1
)
...
...
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