问个小疑点。关于指针数组的

问个小问题。。关于指针数组的
大家好,我编下面的代码时会报“非法索引,不允许间接寻址”的错,请问有什么好办法能解决这个问题吗?
AVCodecContext** aCodecCtx = new AVCodecContext*[tracksIndex];
AVCodec** aCodec = new AVCodec*[tracksIndex];
for(i = 0;i < tracksIndex;i++)
{
  aCodecCtx[i] = ic->streams[audioindex]->codec;  
  aCodec[i] = avcodec_find_decoder( aCodecCtx->codec_id );
  if( avcodec_open(aCodecCtx[i],aCodec[i] ) < 0 )
  {
  strMsg.Format( _T("can't open the #%d audio decoder"),i );
  AfxMessageBox( strMsg );
  return -1;
  }
}


------解决方案--------------------
aCodec[i] = avcodec_find_decoder( aCodecCtx->codec_id );
改成:
aCodec[i] = avcodec_find_decoder( aCodecCtx[i]->codec_id );
------解决方案--------------------
解决了就好