Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
8308f4b5
Commit
8308f4b5
authored
Jan 03, 2019
by
Michael Bradshaw
Committed by
Ronald S. Bultje
Jan 07, 2019
Browse files
Only set Dav1dRef's data field in dav1d_ref_create
parent
c7007c92
Pipeline
#3842
passed with stages
in 5 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/ref.c
View file @
8308f4b5
...
...
@@ -46,6 +46,8 @@ Dav1dRef *dav1d_ref_create(const size_t size) {
res
=
dav1d_ref_wrap
(
data
,
default_free_callback
,
data
);
if
(
!
res
)
{
free
(
data
);
}
else
{
res
->
data
=
data
;
}
return
res
;
...
...
@@ -58,8 +60,7 @@ Dav1dRef *dav1d_ref_wrap(const uint8_t *const ptr,
Dav1dRef
*
res
=
malloc
(
sizeof
(
Dav1dRef
));
if
(
!
res
)
return
NULL
;
if
(
ptr
==
user_data
)
res
->
data
=
user_data
;
res
->
data
=
NULL
;
res
->
const_data
=
ptr
;
atomic_init
(
&
res
->
ref_cnt
,
1
);
res
->
free_callback
=
free_callback
;
...
...
@@ -86,5 +87,5 @@ void dav1d_ref_dec(Dav1dRef **const pref) {
}
int
dav1d_ref_is_writable
(
Dav1dRef
*
const
ref
)
{
return
atomic_load
(
&
ref
->
ref_cnt
)
==
1
;
return
atomic_load
(
&
ref
->
ref_cnt
)
==
1
&&
ref
->
data
;
}
Write
Preview
Supports
Markdown
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