avcodec/rka: fix channel value initialization

This commit is contained in:
Paul B Mahol 2023-02-15 14:11:16 +01:00
parent 83a2007f40
commit 05b859af35
1 changed files with 2 additions and 1 deletions

View File

@ -149,7 +149,8 @@ static av_cold int rka_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
s->channels = avctx->ch_layout.nb_channels;
av_channel_layout_uninit(&avctx->ch_layout);
s->channels = avctx->ch_layout.nb_channels = avctx->extradata[12];
if (s->channels < 1 || s->channels > 2)
return AVERROR_INVALIDDATA;