Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.io.video
Commits
3f4b79c2
Commit
3f4b79c2
authored
Oct 17, 2018
by
André Anjos
💬
Browse files
Fixes frame freeing with more recent APIs in the hopes it will addresses
#10
parent
3b63f6c0
Pipeline
#24403
passed with stage
in 14 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/io/video/cpp/utils.cpp
View file @
3f4b79c2
...
...
@@ -472,10 +472,9 @@ boost::shared_ptr<AVStream> bob::io::video::make_stream(
}
static
void
deallocate_frame
(
AVFrame
*
f
)
{
if
(
f
)
{
if
(
f
->
data
[
0
])
av_free
(
f
->
data
[
0
]);
av_free
(
f
);
}
av_freep
(
&
f
->
data
[
0
]);
av_frame_unref
(
f
);
av_frame_free
(
&
f
);
}
boost
::
shared_ptr
<
AVFrame
>
...
...
@@ -496,7 +495,7 @@ bob::io::video::make_frame(const std::string& filename,
int
ok
=
av_image_alloc
(
retval
->
data
,
retval
->
linesize
,
codec
->
width
,
codec
->
height
,
codec
->
pix_fmt
,
1
);
if
(
ok
<
0
)
{
av_free
(
retval
);
av_
frame_
free
(
&
retval
);
boost
::
format
m
(
"bob::io::video::av_image_alloc(data, linesize, width=%d, height=%d, 1) failed: cannot allocate frame/picture buffer start reading or writing video file `%s'"
);
m
%
codec
->
width
%
codec
->
height
%
filename
;
throw
std
::
runtime_error
(
m
.
str
());
...
...
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