Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
82315be7
Commit
82315be7
authored
Apr 01, 2011
by
John Koleszar
Committed by
Code Review
Apr 01, 2011
Browse files
Merge "vpxenc: die on realloc failures"
parents
ba11e24d
26b6a3b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
vpxenc.c
View file @
82315be7
...
...
@@ -236,7 +236,13 @@ void stats_write(stats_io_t *stats, const void *pkt, size_t len)
stats
->
buf_ptr
=
new_ptr
+
(
stats
->
buf_ptr
-
(
char
*
)
stats
->
buf
.
buf
);
stats
->
buf
.
buf
=
new_ptr
;
stats
->
buf_alloc_sz
=
new_sz
;
}
/* else ... */
}
else
{
fprintf
(
stderr
,
"
\n
Failed to realloc firstpass stats buffer.
\n
"
);
exit
(
EXIT_FAILURE
);
}
}
memcpy
(
stats
->
buf_ptr
,
pkt
,
len
);
...
...
@@ -698,10 +704,18 @@ write_webm_block(EbmlGlobal *glob,
/* Save a cue point if this is a keyframe. */
if
(
is_keyframe
)
{
struct
cue_entry
*
cue
;
struct
cue_entry
*
cue
,
*
new_cue_list
;
new_cue_list
=
realloc
(
glob
->
cue_list
,
(
glob
->
cues
+
1
)
*
sizeof
(
struct
cue_entry
));
if
(
new_cue_list
)
glob
->
cue_list
=
new_cue_list
;
else
{
fprintf
(
stderr
,
"
\n
Failed to realloc cue list.
\n
"
);
exit
(
EXIT_FAILURE
);
}
glob
->
cue_list
=
realloc
(
glob
->
cue_list
,
(
glob
->
cues
+
1
)
*
sizeof
(
struct
cue_entry
));
cue
=
&
glob
->
cue_list
[
glob
->
cues
];
cue
->
time
=
glob
->
cluster_timecode
;
cue
->
loc
=
glob
->
cluster_pos
;
...
...
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