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
d1bec4be
Commit
d1bec4be
authored
May 26, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wavpack: return an error on 0-sized blocks
Such blocks are not valid.
parent
1d177200
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
wavpack.c
libavcodec/wavpack.c
+1
-6
No files found.
libavcodec/wavpack.c
View file @
d1bec4be
...
@@ -765,11 +765,6 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
...
@@ -765,11 +765,6 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
int
i
,
j
,
id
,
size
,
ssize
,
weights
,
t
;
int
i
,
j
,
id
,
size
,
ssize
,
weights
,
t
;
int
bpp
,
chan
,
chmask
,
orig_bpp
;
int
bpp
,
chan
,
chmask
,
orig_bpp
;
if
(
buf_size
==
0
)
{
*
got_frame_ptr
=
0
;
return
0
;
}
if
(
block_no
>=
wc
->
fdec_num
&&
wv_alloc_frame_context
(
wc
)
<
0
)
{
if
(
block_no
>=
wc
->
fdec_num
&&
wv_alloc_frame_context
(
wc
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error creating frame decode context
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error creating frame decode context
\n
"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -1212,7 +1207,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1212,7 +1207,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
frame_size
=
AV_RL32
(
buf
+
8
)
+
12
;
frame_size
=
AV_RL32
(
buf
+
8
)
+
12
;
}
}
}
}
if
(
frame_size
<
0
||
frame_size
>
buf_size
)
{
if
(
frame_size
<
=
0
||
frame_size
>
buf_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Block %d has invalid size (size %d vs. %d bytes left)
\n
"
,
"Block %d has invalid size (size %d vs. %d bytes left)
\n
"
,
s
->
block
,
frame_size
,
buf_size
);
s
->
block
,
frame_size
,
buf_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