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
7b27dd5c
Commit
7b27dd5c
authored
Dec 20, 2016
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmavoice: move overflow handling to common code.
parent
b011bb5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
wmavoice.c
libavcodec/wmavoice.c
+5
-12
No files found.
libavcodec/wmavoice.c
View file @
7b27dd5c
...
...
@@ -1800,6 +1800,11 @@ static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
skip_bits
(
gb
,
10
*
(
res
+
1
));
}
if
(
get_bits_left
(
gb
)
<
0
)
{
wmavoice_flush
(
ctx
);
return
AVERROR_INVALIDDATA
;
}
*
got_frame_ptr
=
1
;
/* Update history */
...
...
@@ -1925,12 +1930,6 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,
cnt
+=
s
->
spillover_nbits
;
s
->
skip_bits_next
=
cnt
&
7
;
res
=
cnt
>>
3
;
if
(
res
>
avpkt
->
size
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Trying to skip %d bytes in packet of size %d
\n
"
,
res
,
avpkt
->
size
);
return
AVERROR_INVALIDDATA
;
}
return
res
;
}
else
skip_bits_long
(
gb
,
s
->
spillover_nbits
-
cnt
+
...
...
@@ -1955,12 +1954,6 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data,
int
cnt
=
get_bits_count
(
gb
);
s
->
skip_bits_next
=
cnt
&
7
;
res
=
cnt
>>
3
;
if
(
res
>
avpkt
->
size
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Trying to skip %d bytes in packet of size %d
\n
"
,
res
,
avpkt
->
size
);
return
AVERROR_INVALIDDATA
;
}
return
res
;
}
}
else
if
((
s
->
sframe_cache_size
=
pos
)
>
0
)
{
...
...
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