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
5d42ac7f
Commit
5d42ac7f
authored
Feb 20, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo_enc: only allocate output packet when we know there will be output
Fixes a memleak.
parent
b38b6d56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+14
-14
No files found.
libavcodec/mpegvideo_enc.c
View file @
5d42ac7f
...
...
@@ -1384,6 +1384,17 @@ int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
int
i
,
stuffing_count
,
ret
;
int
context_count
=
s
->
slice_context_count
;
s
->
picture_in_gop_number
++
;
if
(
load_input_picture
(
s
,
pic_arg
)
<
0
)
return
-
1
;
if
(
select_input_picture
(
s
)
<
0
)
{
return
-
1
;
}
/* output? */
if
(
s
->
new_picture
.
f
.
data
[
0
])
{
if
(
!
pkt
->
data
&&
(
ret
=
ff_alloc_packet
(
pkt
,
s
->
mb_width
*
s
->
mb_height
*
MAX_MB_BYTES
))
<
0
)
return
ret
;
...
...
@@ -1398,17 +1409,6 @@ int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits
(
&
s
->
thread_context
[
i
]
->
pb
,
start
,
end
-
start
);
}
s
->
picture_in_gop_number
++
;
if
(
load_input_picture
(
s
,
pic_arg
)
<
0
)
return
-
1
;
if
(
select_input_picture
(
s
)
<
0
)
{
return
-
1
;
}
/* output? */
if
(
s
->
new_picture
.
f
.
data
[
0
])
{
s
->
pict_type
=
s
->
new_picture
.
f
.
pict_type
;
//emms_c();
//printf("qs:%f %f %d\n", s->new_picture.quality,
...
...
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