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
47c9887e
Commit
47c9887e
authored
Jun 26, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/utils: improve feedback in case of invalid packet size
parent
c58d535b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
utils.c
libavcodec/utils.c
+7
-2
No files found.
libavcodec/utils.c
View file @
47c9887e
...
@@ -1395,8 +1395,13 @@ free_and_end:
...
@@ -1395,8 +1395,13 @@ free_and_end:
int
ff_alloc_packet2
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
int
size
)
int
ff_alloc_packet2
(
AVCodecContext
*
avctx
,
AVPacket
*
avpkt
,
int
size
)
{
{
if
(
size
<
0
||
avpkt
->
size
<
0
||
size
>
INT_MAX
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
if
(
avpkt
->
size
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Size %d invalid
\n
"
,
size
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid negative user packet size %d
\n
"
,
avpkt
->
size
);
return
AVERROR
(
EINVAL
);
}
if
(
size
<
0
||
size
>
INT_MAX
-
FF_INPUT_BUFFER_PADDING_SIZE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid minimum required packet size %d (max allowed is %d)
\n
"
,
size
,
INT_MAX
-
FF_INPUT_BUFFER_PADDING_SIZE
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
...
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