#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];
#include "mathops.h"
#include "pcm_tablegen.h"
-#define MAX_CHANNELS 64
-
static av_cold int pcm_encode_init(AVCodecContext *avctx)
{
avctx->frame_size = 0;
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);
}
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];
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;
}