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
5e268633
Commit
5e268633
authored
May 23, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not leak extradata when encoding avui.
parent
fb6c6b15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
avuienc.c
libavcodec/avuienc.c
+11
-8
No files found.
libavcodec/avuienc.c
View file @
5e268633
...
...
@@ -35,6 +35,16 @@ static av_cold int avui_encode_init(AVCodecContext *avctx)
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not allocate frame.
\n
"
);
return
AVERROR
(
ENOMEM
);
}
if
(
!
(
avctx
->
extradata
=
av_mallocz
(
24
+
FF_INPUT_BUFFER_PADDING_SIZE
)))
return
AVERROR
(
ENOMEM
);
avctx
->
extradata_size
=
24
;
memcpy
(
avctx
->
extradata
,
"
\0\0\0\x18
""APRGAPRG0001"
,
16
);
if
(
avctx
->
field_order
>
AV_FIELD_PROGRESSIVE
)
{
avctx
->
extradata
[
19
]
=
2
;
}
else
{
avctx
->
extradata
[
19
]
=
1
;
}
return
0
;
}
...
...
@@ -56,14 +66,7 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if
((
ret
=
ff_alloc_packet2
(
avctx
,
pkt
,
size
))
<
0
)
return
ret
;
dst
=
pkt
->
data
;
if
(
!
(
avctx
->
extradata
=
av_mallocz
(
24
+
FF_INPUT_BUFFER_PADDING_SIZE
)))
return
AVERROR
(
ENOMEM
);
avctx
->
extradata_size
=
24
;
memcpy
(
avctx
->
extradata
,
"
\0\0\0\x18
""APRGAPRG0001"
,
16
);
if
(
interlaced
)
{
avctx
->
extradata
[
19
]
=
2
;
}
else
{
avctx
->
extradata
[
19
]
=
1
;
if
(
!
interlaced
)
{
dst
+=
avctx
->
width
*
skip
;
}
...
...
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