Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
acefe86e
Commit
acefe86e
authored
Feb 27, 2014
by
James Zern
Committed by
Gerrit Code Review
Feb 27, 2014
Browse files
Merge "y4m_video_source: fix memory leak"
parents
90cc310e
f651bcb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/y4m_video_source.h
View file @
acefe86e
...
...
@@ -35,14 +35,11 @@ class Y4mVideoSource : public VideoSource {
virtual
~
Y4mVideoSource
()
{
vpx_img_free
(
img_
.
get
());
y4m_input_close
(
&
y4m_
);
if
(
input_file_
)
fclose
(
input_file_
);
CloseSource
();
}
virtual
void
Begin
()
{
if
(
input_file_
)
fclose
(
input_file_
);
CloseSource
();
input_file_
=
OpenTestDataFile
(
file_name_
);
ASSERT_TRUE
(
input_file_
!=
NULL
)
<<
"Input file open failed. Filename: "
<<
file_name_
;
...
...
@@ -89,6 +86,15 @@ class Y4mVideoSource : public VideoSource {
}
protected:
void
CloseSource
()
{
y4m_input_close
(
&
y4m_
);
y4m_
=
y4m_input
();
if
(
input_file_
!=
NULL
)
{
fclose
(
input_file_
);
input_file_
=
NULL
;
}
}
std
::
string
file_name_
;
FILE
*
input_file_
;
testing
::
internal
::
scoped_ptr
<
vpx_image_t
>
img_
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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