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
cfa317f6
Commit
cfa317f6
authored
Sep 16, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shorten: validate block size
parent
45d7d31f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
shorten.c
libavcodec/shorten.c
+15
-2
No files found.
libavcodec/shorten.c
View file @
cfa317f6
...
...
@@ -330,8 +330,16 @@ static int read_header(ShortenContext *s)
/* get blocksize if version > 0 */
if
(
s
->
version
>
0
)
{
int
skip_bytes
;
s
->
blocksize
=
get_uint
(
s
,
av_log2
(
DEFAULT_BLOCK_SIZE
));
int
skip_bytes
,
blocksize
;
blocksize
=
get_uint
(
s
,
av_log2
(
DEFAULT_BLOCK_SIZE
));
if
(
!
blocksize
||
blocksize
>
MAX_BLOCKSIZE
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"invalid or unsupported block size: %d
\n
"
,
blocksize
);
return
AVERROR
(
EINVAL
);
}
s
->
blocksize
=
blocksize
;
maxnlpc
=
get_uint
(
s
,
LPCQSIZE
);
s
->
nmean
=
get_uint
(
s
,
0
);
...
...
@@ -456,6 +464,11 @@ static int shorten_decode_frame(AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Increasing block size is not supported
\n
"
);
return
AVERROR_PATCHWELCOME
;
}
if
(
!
blocksize
||
blocksize
>
MAX_BLOCKSIZE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid or unsupported "
"block size: %d
\n
"
,
blocksize
);
return
AVERROR
(
EINVAL
);
}
s
->
blocksize
=
blocksize
;
break
;
}
...
...
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