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
b5d56d8e
Commit
b5d56d8e
authored
Nov 28, 2017
by
Aman Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/videotoolbox: fix SEGV when hwaccel decoding h264 with ffmpeg.c
Signed-off-by:
Aman Gupta
<
aman@tmm1.net
>
parent
d5d2632e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
videotoolbox.c
libavcodec/videotoolbox.c
+7
-1
No files found.
libavcodec/videotoolbox.c
View file @
b5d56d8e
...
...
@@ -119,7 +119,8 @@ CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx)
// save sps header (profile/level) used to create decoder session,
// so we can detect changes and recreate it.
memcpy
(
vtctx
->
sps
,
h
->
ps
.
sps
->
data
+
1
,
3
);
if
(
vtctx
)
memcpy
(
vtctx
->
sps
,
h
->
ps
.
sps
->
data
+
1
,
3
);
data
=
CFDataCreate
(
kCFAllocatorDefault
,
vt_extradata
,
vt_extradata_size
);
av_free
(
vt_extradata
);
...
...
@@ -323,6 +324,11 @@ static int videotoolbox_h264_decode_params(AVCodecContext *avctx,
uint32_t
size
)
{
VTContext
*
vtctx
=
avctx
->
internal
->
hwaccel_priv_data
;
H264Context
*
h
=
avctx
->
priv_data
;
// save sps header (profile/level) used to create decoder session
if
(
!
vtctx
->
sps
[
0
])
memcpy
(
vtctx
->
sps
,
h
->
ps
.
sps
->
data
+
1
,
3
);
if
(
type
==
H264_NAL_SPS
)
{
if
(
size
>
4
&&
memcmp
(
vtctx
->
sps
,
buffer
+
1
,
3
)
!=
0
)
{
...
...
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