diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 8e66928db5..1d1f7eca07 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -343,6 +343,7 @@ static int read_header(ShortenContext *s) s->channels = get_uint(s, CHANSIZE); if (s->channels <= 0 || s->channels > MAX_CHANNELS) { av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels); + s->channels = 0; return AVERROR_INVALIDDATA; } s->avctx->channels = s->channels;