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
f6803cfb
Commit
f6803cfb
authored
Mar 12, 2019
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libdav1d: unref the frame on failure
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
38a41321
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
libdav1d.c
libavcodec/libdav1d.c
+16
-8
No files found.
libavcodec/libdav1d.c
View file @
f6803cfb
...
...
@@ -231,7 +231,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
if
(
c
->
width
!=
p
->
p
.
w
||
c
->
height
!=
p
->
p
.
h
)
{
res
=
ff_set_dimensions
(
c
,
p
->
p
.
w
,
p
->
p
.
h
);
if
(
res
<
0
)
return
res
;
goto
fail
;
}
switch
(
p
->
seq_hdr
->
chr
)
{
...
...
@@ -272,13 +272,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
frame
->
pict_type
=
AV_PICTURE_TYPE_SP
;
break
;
default:
return
AVERROR_INVALIDDATA
;
res
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
if
(
p
->
mastering_display
)
{
AVMasteringDisplayMetadata
*
mastering
=
av_mastering_display_metadata_create_side_data
(
frame
);
if
(
!
mastering
)
return
AVERROR
(
ENOMEM
);
if
(
!
mastering
)
{
res
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
mastering
->
display_primaries
[
i
][
0
]
=
av_make_q
(
p
->
mastering_display
->
primaries
[
i
][
0
],
1
<<
16
);
...
...
@@ -295,14 +298,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
if
(
p
->
content_light
)
{
AVContentLightMetadata
*
light
=
av_content_light_metadata_create_side_data
(
frame
);
if
(
!
light
)
return
AVERROR
(
ENOMEM
);
if
(
!
light
)
{
res
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
light
->
MaxCLL
=
p
->
content_light
->
max_content_light_level
;
light
->
MaxFALL
=
p
->
content_light
->
max_frame_average_light_level
;
}
return
0
;
res
=
0
;
fail:
if
(
res
<
0
)
av_frame_unref
(
frame
);
return
res
;
}
static
av_cold
int
libdav1d_close
(
AVCodecContext
*
c
)
...
...
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