avcodec/012v: Check dimensions more completely