Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
bb6941af
Commit
bb6941af
authored
Oct 22, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders
parent
6b07830a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
internal.h
libavcodec/internal.h
+2
-0
pcm.c
libavcodec/pcm.c
+2
-4
utils.c
libavcodec/utils.c
+1
-2
No files found.
libavcodec/internal.h
View file @
bb6941af
...
...
@@ -30,6 +30,8 @@
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#define FF_SANE_NB_CHANNELS 128U
typedef
struct
InternalBuffer
{
uint8_t
*
base
[
AV_NUM_DATA_POINTERS
];
uint8_t
*
data
[
AV_NUM_DATA_POINTERS
];
...
...
libavcodec/pcm.c
View file @
bb6941af
...
...
@@ -31,8 +31,6 @@
#include "mathops.h"
#include "pcm_tablegen.h"
#define MAX_CHANNELS 64
static
av_cold
int
pcm_encode_init
(
AVCodecContext
*
avctx
)
{
avctx
->
frame_size
=
0
;
...
...
@@ -210,7 +208,7 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx)
PCMDecode
*
s
=
avctx
->
priv_data
;
int
i
;
if
(
avctx
->
channels
<=
0
||
avctx
->
channels
>
MAX_CHANNELS
)
{
if
(
avctx
->
channels
<=
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"PCM channels out of bounds
\n
"
);
return
AVERROR
(
EINVAL
);
}
...
...
@@ -340,7 +338,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data,
break
;
case
AV_CODEC_ID_PCM_S16LE_PLANAR
:
{
const
uint8_t
*
src2
[
MAX
_CHANNELS
];
const
uint8_t
*
src2
[
FF_SANE_NB
_CHANNELS
];
n
/=
avctx
->
channels
;
for
(
c
=
0
;
c
<
avctx
->
channels
;
c
++
)
src2
[
c
]
=
&
src
[
c
*
n
*
2
];
...
...
libavcodec/utils.c
View file @
bb6941af
...
...
@@ -758,8 +758,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if
(
av_codec_is_decoder
(
codec
))
av_freep
(
&
avctx
->
subtitle_header
);
#define SANE_NB_CHANNELS 128U
if
(
avctx
->
channels
>
SANE_NB_CHANNELS
)
{
if
(
avctx
->
channels
>
FF_SANE_NB_CHANNELS
)
{
ret
=
AVERROR
(
EINVAL
);
goto
free_and_end
;
}
...
...
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