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
ced7238c
Commit
ced7238c
authored
Oct 15, 2014
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpdec_hevc: Use av_realloc instead of av_malloc+memcpy
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
752e71e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
rtpdec_hevc.c
libavformat/rtpdec_hevc.c
+5
-9
No files found.
libavformat/rtpdec_hevc.c
View file @
ced7238c
...
@@ -124,24 +124,20 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
...
@@ -124,24 +124,20 @@ static av_cold int hevc_sdp_parse_fmtp_config(AVFormatContext *s,
decoded_packet_size
=
av_base64_decode
(
decoded_packet
,
base64packet
,
decoded_packet_size
=
av_base64_decode
(
decoded_packet
,
base64packet
,
sizeof
(
decoded_packet
));
sizeof
(
decoded_packet
));
if
(
decoded_packet_size
>
0
)
{
if
(
decoded_packet_size
>
0
)
{
uint8_t
*
dest
=
av_malloc
(
decoded_packet_size
+
uint8_t
*
tmp
=
av_realloc
(
*
data_ptr
,
decoded_packet_size
+
sizeof
(
start_sequence
)
+
*
size_ptr
);
sizeof
(
start_sequence
)
+
*
size_ptr
);
if
(
!
dest
)
{
if
(
!
tmp
)
{
av_log
(
s
,
AV_LOG_ERROR
,
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to allocate memory for extradata!
\n
"
);
"Unable to allocate memory for extradata!
\n
"
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
if
(
*
size_ptr
)
{
*
data_ptr
=
tmp
;
memcpy
(
dest
,
*
data_ptr
,
*
size_ptr
);
av_free
(
*
data_ptr
);
}
memcpy
(
dest
+
*
size_ptr
,
start_sequence
,
memcpy
(
*
data_ptr
+
*
size_ptr
,
start_sequence
,
sizeof
(
start_sequence
));
sizeof
(
start_sequence
));
memcpy
(
dest
+
*
size_ptr
+
sizeof
(
start_sequence
),
memcpy
(
*
data_ptr
+
*
size_ptr
+
sizeof
(
start_sequence
),
decoded_packet
,
decoded_packet_size
);
decoded_packet
,
decoded_packet_size
);
*
data_ptr
=
dest
;
*
size_ptr
+=
sizeof
(
start_sequence
)
+
decoded_packet_size
;
*
size_ptr
+=
sizeof
(
start_sequence
)
+
decoded_packet_size
;
}
}
}
}
...
...
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