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
28fb80dc
Commit
28fb80dc
authored
May 31, 2015
by
Vittorio Giovara
Committed by
Luca Barbato
May 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svq1: Check memory allocation
parent
42df71d9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
svq1enc.c
libavcodec/svq1enc.c
+16
-1
No files found.
libavcodec/svq1enc.c
View file @
28fb80dc
...
...
@@ -292,6 +292,8 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
s
->
motion_val16
[
plane
]
=
av_mallocz
((
s
->
m
.
mb_stride
*
(
block_height
+
2
)
+
1
)
*
2
*
sizeof
(
int16_t
));
if
(
!
s
->
motion_val8
[
plane
]
||
!
s
->
motion_val16
[
plane
])
return
AVERROR
(
ENOMEM
);
}
s
->
m
.
mb_type
=
s
->
mb_type
;
...
...
@@ -549,6 +551,12 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
s
->
y_block_height
*
sizeof
(
int32_t
));
s
->
ssd_int8_vs_int16
=
ssd_int8_vs_int16_c
;
if
(
!
s
->
m
.
me
.
temp
||
!
s
->
m
.
me
.
scratchpad
||
!
s
->
m
.
me
.
map
||
!
s
->
m
.
me
.
score_map
||
!
s
->
mb_type
||
!
s
->
dummy
)
{
svq1_encode_end
(
avctx
);
return
AVERROR
(
ENOMEM
);
}
if
(
ARCH_PPC
)
ff_svq1enc_init_ppc
(
s
);
if
(
ARCH_X86
)
...
...
@@ -612,8 +620,15 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s
->
frame_width
/
(
i
?
4
:
1
),
s
->
frame_height
/
(
i
?
4
:
1
),
pict
->
linesize
[
i
],
s
->
current_picture
->
linesize
[
i
])
<
0
)
s
->
current_picture
->
linesize
[
i
])
<
0
)
{
int
j
;
for
(
j
=
0
;
j
<
i
;
j
++
)
{
av_freep
(
&
s
->
motion_val8
[
j
]);
av_freep
(
&
s
->
motion_val16
[
j
]);
}
av_freep
(
&
s
->
scratchbuf
);
return
-
1
;
}
// avpriv_align_put_bits(&s->pb);
while
(
put_bits_count
(
&
s
->
pb
)
&
31
)
...
...
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