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
1b5a189f
Commit
1b5a189f
authored
Sep 20, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sipr: fix the output data size check and only calculate it once.
parent
12bd8532
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
sipr.c
libavcodec/sipr.c
+7
-4
No files found.
libavcodec/sipr.c
View file @
1b5a189f
...
@@ -509,7 +509,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
...
@@ -509,7 +509,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
GetBitContext
gb
;
GetBitContext
gb
;
float
*
data
=
datap
;
float
*
data
=
datap
;
int
subframe_size
=
ctx
->
mode
==
MODE_16k
?
L_SUBFR_16k
:
SUBFR_SIZE
;
int
subframe_size
=
ctx
->
mode
==
MODE_16k
?
L_SUBFR_16k
:
SUBFR_SIZE
;
int
i
;
int
i
,
out_size
;
ctx
->
avctx
=
avctx
;
ctx
->
avctx
=
avctx
;
if
(
avpkt
->
size
<
(
mode_par
->
bits_per_frame
>>
3
))
{
if
(
avpkt
->
size
<
(
mode_par
->
bits_per_frame
>>
3
))
{
...
@@ -520,7 +520,11 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
...
@@ -520,7 +520,11 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
*
data_size
=
0
;
*
data_size
=
0
;
return
-
1
;
return
-
1
;
}
}
if
(
*
data_size
<
subframe_size
*
mode_par
->
subframe_count
*
sizeof
(
float
))
{
out_size
=
mode_par
->
frames_per_packet
*
subframe_size
*
mode_par
->
subframe_count
*
av_get_bytes_per_sample
(
avctx
->
sample_fmt
);
if
(
*
data_size
<
out_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error processing packet: output buffer (%d) too small
\n
"
,
"Error processing packet: output buffer (%d) too small
\n
"
,
*
data_size
);
*
data_size
);
...
@@ -542,8 +546,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
...
@@ -542,8 +546,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap,
data
+=
subframe_size
*
mode_par
->
subframe_count
;
data
+=
subframe_size
*
mode_par
->
subframe_count
;
}
}
*
data_size
=
mode_par
->
frames_per_packet
*
subframe_size
*
*
data_size
=
out_size
;
mode_par
->
subframe_count
*
sizeof
(
float
);
return
mode_par
->
bits_per_frame
>>
3
;
return
mode_par
->
bits_per_frame
>>
3
;
}
}
...
...
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