... | ... |
@@ -117,6 +117,11 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx) |
117 | 117 |
int i; |
118 | 118 |
short square; |
119 | 119 |
|
120 |
+ if (avctx->channels < 1 || avctx->channels > 2) { |
|
121 |
+ av_log(avctx, AV_LOG_INFO, "invalid number of channels\n"); |
|
122 |
+ return AVERROR(EINVAL); |
|
123 |
+ } |
|
124 |
+ |
|
120 | 125 |
s->channels = avctx->channels; |
121 | 126 |
s->sample[0] = s->sample[1] = 0; |
122 | 127 |
|