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
9aba0a6f
Commit
9aba0a6f
authored
Dec 13, 2013
by
Michael Niedermayer
Committed by
Martin Storsjö
Dec 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpdec_h264: Check the return value of functions doing allocations
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
6451c885
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
rtpdec_h264.c
libavformat/rtpdec_h264.c
+8
-4
No files found.
libavformat/rtpdec_h264.c
View file @
9aba0a6f
...
...
@@ -190,7 +190,8 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
switch
(
type
)
{
case
0
:
// undefined, but pass them through
case
1
:
av_new_packet
(
pkt
,
len
+
sizeof
(
start_sequence
));
if
((
result
=
av_new_packet
(
pkt
,
len
+
sizeof
(
start_sequence
)))
<
0
)
return
result
;
memcpy
(
pkt
->
data
,
start_sequence
,
sizeof
(
start_sequence
));
memcpy
(
pkt
->
data
+
sizeof
(
start_sequence
),
buf
,
len
);
COUNT_NAL_TYPE
(
data
,
nal
);
...
...
@@ -247,7 +248,8 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
if
(
pass
==
0
)
{
/* now we know the total size of the packet (with the
* start sequences added) */
av_new_packet
(
pkt
,
total_length
);
if
((
result
=
av_new_packet
(
pkt
,
total_length
))
<
0
)
return
result
;
dst
=
pkt
->
data
;
}
else
{
assert
(
dst
-
pkt
->
data
==
total_length
);
...
...
@@ -292,12 +294,14 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
COUNT_NAL_TYPE
(
data
,
nal_type
);
if
(
start_bit
)
{
/* copy in the start sequence, and the reconstructed nal */
av_new_packet
(
pkt
,
sizeof
(
start_sequence
)
+
sizeof
(
nal
)
+
len
);
if
((
result
=
av_new_packet
(
pkt
,
sizeof
(
start_sequence
)
+
sizeof
(
nal
)
+
len
))
<
0
)
return
result
;
memcpy
(
pkt
->
data
,
start_sequence
,
sizeof
(
start_sequence
));
pkt
->
data
[
sizeof
(
start_sequence
)]
=
reconstructed_nal
;
memcpy
(
pkt
->
data
+
sizeof
(
start_sequence
)
+
sizeof
(
nal
),
buf
,
len
);
}
else
{
av_new_packet
(
pkt
,
len
);
if
((
result
=
av_new_packet
(
pkt
,
len
))
<
0
)
return
result
;
memcpy
(
pkt
->
data
,
buf
,
len
);
}
}
else
{
...
...
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