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
50c466d6
Commit
50c466d6
authored
Oct 28, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g726enc: use av_assert0() for sample_rate validation
This should never happen, but the check avoids a divide-by-zero.
parent
9e78d8cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
g726.c
libavcodec/g726.c
+2
-4
No files found.
libavcodec/g726.c
View file @
50c466d6
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include <limits.h>
#include <limits.h>
#include "libavutil/avassert.h"
#include "avcodec.h"
#include "avcodec.h"
#include "get_bits.h"
#include "get_bits.h"
#include "put_bits.h"
#include "put_bits.h"
...
@@ -309,10 +310,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
...
@@ -309,10 +310,7 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
"Resample or reduce the compliance level.
\n
"
);
"Resample or reduce the compliance level.
\n
"
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
if
(
avctx
->
sample_rate
<=
0
)
{
av_assert0
(
avctx
->
sample_rate
>
0
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Samplerate is invalid
\n
"
);
return
-
1
;
}
if
(
avctx
->
channels
!=
1
){
if
(
avctx
->
channels
!=
1
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only mono is supported
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only mono is supported
\n
"
);
...
...
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